How do I make all my pages from one website redirect to a different site?

Discussion in 'Site & Server Administration' started by powwka, Jan 24, 2007.

  1. #1
    I have a website that I basically redesigned, and I got a new domain for it. So I want to redirect the traffic from the old site to the new site's homepage.
    I messed around with domain forwarding, but that seems to only direct the homepage of the old site to the new site.
     
    powwka, Jan 24, 2007 IP
  2. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Assuming your server runs apache, type the following in .htaccess file on the root (public_html, etc) folder :
    Replace olddomain,newdomain,.com with appropriate values.

    
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC]
    RewriteRule ^(.*)$ http://www.newdomain.com [R=301,L]
    
    Code (markup):
    Let me know if it works
     
    agnivo007, Jan 25, 2007 IP
  3. powwka

    powwka Peon

    Messages:
    583
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I can't find the .htaccess file. (I have GoDaddy hosting)
     
    powwka, Jan 26, 2007 IP
  4. threebuckchuck

    threebuckchuck Peon

    Messages:
    489
    Likes Received:
    97
    Best Answers:
    0
    Trophy Points:
    0
    #4
    threebuckchuck, Jan 26, 2007 IP