I need to catch and redirect all traffic from one domain to another

Discussion in 'Site & Server Administration' started by ly2, Jul 23, 2006.

  1. #1
    Can someone please give me an example? I have tried all kinds of htaccess codes but so far I can only make my homepage redirect to the new domain.

    I want to catch traffic from the entire site and redirect it all to a new domain.
    =[
     
    ly2, Jul 23, 2006 IP
  2. brunozugay

    brunozugay Peon

    Messages:
    150
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this:

    redirect 301 / http://www.newdomain.com/
    Code (markup):
     
    brunozugay, Jul 23, 2006 IP
  3. ewan

    ewan Peon

    Messages:
    233
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    redirect 302, that may work too
     
    ewan, Jul 23, 2006 IP
  4. ly2

    ly2 Notable Member

    Messages:
    4,093
    Likes Received:
    222
    Best Answers:
    0
    Trophy Points:
    205
    #4
    yea, thats what I orginally did and it only worked for my main page. The inner pages still wont redirect =[
     
    ly2, Jul 23, 2006 IP
  5. brunozugay

    brunozugay Peon

    Messages:
    150
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This is what you have to do then:

    
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
    
    Code (markup):
     
    brunozugay, Jul 23, 2006 IP
  6. ly2

    ly2 Notable Member

    Messages:
    4,093
    Likes Received:
    222
    Best Answers:
    0
    Trophy Points:
    205
    #6
    ly2, Jul 23, 2006 IP
  7. brunozugay

    brunozugay Peon

    Messages:
    150
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hmm... Very strange.

    You want all the requests to custom-cabinets.org to go somewhere else?

    Is there anything else in your .htaccess file?

    Try this:

    redirectMatch 301 ^(.*)$ http://www.newdomain.com
    Code (markup):
     
    brunozugay, Jul 23, 2006 IP