Help needed for 301 redirect using htaccess

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help needed for 301 redirect using htaccess

    I want to redirect all pages in my old domain to my new domain

    i used the below code for redirecting all pages in the old domain

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]


    but this redirecting is not working correctly when any page names contain a space ..how can i fix this ?

    any1 pls help out ...
    Last edited by phpnoob; 05.09.11, 17:54. Reason: typing error

    #2
    try this
    Code:
    Redirect 301 / http://Yournewdomainname.com/

    Comment


      #3
      Originally posted by atef View Post
      try this
      Code:
      Redirect 301 / http://Yournewdomainname.com/
      thanks a lot buddy ,...that fixed my space problem...
      now can i ask one more doubt regarding folders ...
      I just want to keep my index there and redirect and redirect all other pages..
      Is that possible with this redirect ??

      Comment


        #4
        delete/rename all ur site contets or move them at a secret folder and use this
        Code:
        ErrorDocument 400 http://yournewdomainname.com
        ErrorDocument 401 http://yournewdomainname.com
        ErrorDocument 403 http://yournewdomainname.com
        ErrorDocument 404 http://yournewdomainname.com
        ErrorDocument 500 http://yournewdomainname.com
        if u done that all will redirect expect index and that secret folder

        Comment

        Working...
        X