301 Forwarding!

Discussion in 'Site & Server Administration' started by nickharper, Jun 17, 2008.

  1. #1
    I just wondered how I go about forwarding any bit of traffic to anything in the root even if it is 1212712by1v2.html to the /forum folder?

    Thanks
     
    nickharper, Jun 17, 2008 IP
  2. mellow-h

    mellow-h Peon

    Messages:
    750
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^backup.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.backup.com$
    RewriteRule ^/?$ "http\:\/\/www\.backup\.com\/forum" [R=301,L]
    
    Code (markup):
    Replace backup.com with your domain :cool:
     
    mellow-h, Jun 17, 2008 IP
  3. nickharper

    nickharper Active Member

    Messages:
    732
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    75
    #3
    I have just tried it with this:

    Although if I go to http://www.skybluestalk.co.uk/test.html it doesn't forward it :(
     
    nickharper, Jun 18, 2008 IP
  4. mellow-h

    mellow-h Peon

    Messages:
    750
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hmm, this should work for you then:

    
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^backup.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.backup.com$ [OR]
    RewriteCond %{HTTP_HOST} ^backup.com/.*$ [OR]
    RewriteCond %{HTTP_HOST} ^www.backup.com/.*$ [OR]
    RewriteRule ^/?$ "http\:\/\/www\.backup\.com\/forum" [R=301,L]
    
    Code (markup):
     
    mellow-h, Jun 18, 2008 IP