SEO Best Practices Search Engine Forums  

Go Back   SEO Best Practices Search Engine Forums > Miscellaneous Search Engine Information > Free Help & Advice

Free Help & Advice Ask any questions you wish. See if you can stump our members. Limit questions to the search engine field. ALL general questions about search engines should go in here. NOT in the Google Forum!!

 
 
Thread Tools Rating: Thread Rating: 7 votes, 4.71 average. Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 15-09-2005
g1smd's Avatar
g1smd g1smd is offline
Registered User
 
Join Date: Oct 2002
Location: UK
Posts: 6,525
Rep Power: 21
g1smd is on a distinguished road
301 Redirects for multiple domains.

This is what you need for an Apache webserver:


Options +FollowSymLinks
RewriteEngine on


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

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


First block you need once only.

Second block: you need one for each domain.com that needs redirecting (including newdomain.com to www.newdomain.com too).

Third block: you need one for each www.domain.com that needs redirecting to www.newdomain.com.

Remove all of the blank lines from the above example.

Put it all in the .htaccess file in the web root folder.


Before you upload a new .htaccess file, make sure, using FTP, that there isn't one already there as the new one will overwrite it. Be aware, too, that many FTP programs are set to hide all file names that begin with a dot; so you need to unset that option first.


Point all of the domains involved to that one webserver, and load the .htaccess file onto that same webserver too. This will force that webserver to have just one canonical name for every and all pages accessed.

Last edited by g1smd; 15-09-2005 at 18:17/06:17PM.
Reply With Quote
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -4. The time now is 06:11/06:11AM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©1998 - 2010, ihelpyou, Inc.