.htaccess Redirect Problems

Discussion in 'Apache' started by That-Guy, Aug 1, 2009.

  1. #1
    OK guys hoping you can help.

    I have moved my blog to a new domain name and setup a redirect on the old domain as follows:

    
    Redirect 301 / http://www.thetechyblog.com/
    Code (markup):
    It all works fine but if they try and access a page on the old blog like:

    
    http://www.OLDSITEURL.COM/category/computers-and-internet
    Code (markup):
    It tries to redirect to:

    
    http://www.thetechyblog.com/category/computers-and-internet
    Code (markup):
    Which does not exist. It it possible to set the redirect up so no matter what page they visit on the old site it simply redirects to:

    
    http://www.thetechyblog.com
    
    Code (markup):

    Thanks in Advance :)
     
    That-Guy, Aug 1, 2009 IP
  2. That-Guy

    That-Guy Peon

    Messages:
    452
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Found a solution I used the following code instead:

    
    RewriteEngine on
    RewriteRule (.*) http://www.thetechyblog.com/ [R=301,L]
    Code (markup):
    I hope this is correct?
     
    That-Guy, Aug 1, 2009 IP
  3. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #3
    Yes

    RewriteEngine on
    RewriteRule (.*) http://www.thetechyblog.com/ [R=301,L]
    Code (markup):
    should do the trick
     
    Bohra, Aug 1, 2009 IP