Need urgent help for 301 redirection

Discussion in 'Apache' started by webcoolest, Mar 19, 2009.

  1. #1
    Hi

    I want to redirect few pages from old URL to new URL, so I have created .htaccess file and put following code there :-

    RewriteEngine on
    RewriteBase /
    
    RewriteRule ^old_page_URL\.htm$ http://www.mydomain.com/index.html [R=301,L]
    Code (markup):
    Is the above mentioned code ok for 301 redirection? Or do I need to add any other code with above code. Please let me know....

    Regards
    Waby
     
    webcoolest, Mar 19, 2009 IP
  2. xd2

    xd2 Peon

    Messages:
    694
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think that is fine for what you want or you can use:
    RewriteEngine on
    RewriteBase /
    
    RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L] 
    Code (markup):
    To redirect everything.
     
    xd2, Mar 22, 2009 IP
  3. webcoolest

    webcoolest Peon

    Messages:
    102
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for confirm me.... I little bit confused about it.
     
    webcoolest, Mar 23, 2009 IP