.htaccess Catching All Old Links - 301 to New Homepage

Discussion in 'Apache' started by T0PS3O, Nov 2, 2006.

  1. #1
    Probably one for Nintendo and other htaccess guru's alike.

    I bought a domain and I don't need to content, just want to keep the links.

    How do I redirect any link, *, to the new domain?

    I'm guessing something like:

    RewriteRule ^(.*)$ http://www.newdomain.co.uk/index.html [R=301,L]
    Code (markup):
    But I haven't tried it.
     
    T0PS3O, Nov 2, 2006 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    domain.com/.htaccess

    Try

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^(.*)$ http://www.newdomain.co.uk/ [R=301,L]

    though I've seen trouble when URLs were complicated.
     
    Nintendo, Nov 3, 2006 IP
    T0PS3O likes this.
  3. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Cool thanks! Looks like I got it almost right then. I'll give that a shot, thanks!
     
    T0PS3O, Nov 3, 2006 IP
  4. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #4
    I've used that to redirect a complete vBulletin,

    RewriteRule ^(.*)$ http://www.domain.com/mb/$1 [R=301,L]

    though some times people have trouble using a code like this. I'm not sure what to do if the code doesn't work. Next suggestion I always give is to *gags* go to WebmasterWorld. *gags*
     
    Nintendo, Nov 3, 2006 IP