Use Htaccess To Redirect Old Domain To New

Wednesday 20th April 2005 05:43:00 AM

If you ever change your domain name and want your existing traffic redirected from the old to the new, htaccess is simply a great way of acomplishing this.

The code below redirects users as well as search engines informing them that the pages have moved permanently to the new address. It will also redirect any subdomains.

RewriteCond %{HTTP_HOST} ^(.*)olddomain.com$ [NC]
RewriteRule ^.*$ http://www.newdomain.com%{REQUEST_URI} [R=301,L]


Posted by Piniyini in Htaccess

<< I'm going to sexually molest your dog   Toseef's Blog   Website To Include WWW As Prefix Or Not? >>

post comments feed
Post a comment   Track comments
Search

Feeds (Subscribe via Google Reader)
blog posts feed Blog Posts
recent comments feed Recent Comments

Archives
July 2008
May 2008
April 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
September 2004
August 2004

Recent Comments
Check out my Blog Roll
/Htaccess

Says thanks to the following poeple for recently leaving a comment ...

Sami
Wally1973
Mari
Thebrowngirl
Debbie
Sally Feser
Specs
No One
Sobi
Akanksha
Amir
Lost Bedouin
Piniyini
Ash
Smee