Western Union Locations - Upvc Doors - The eBay Song - Loans - Free Ringtones

PDA

View Full Version : correct 301 coding


leeds1
Jan 15th 2005, 4:39 am
Can some confirm the correct way to 301 redirect stuff:


Scenario1
----------
redirect domain.com to www.domain.com

Is it:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^domain\.co.uk
RewriteRule ^(.*)$ http://www.domain.co.uk/$1 [R=permanent,L]



Scenario2
-----------
redirect www.domain.com to www.domain.co.uk

Is it:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^(.*)$ http://www.domain.co.uk/$1 [R=permanent,L]




does the R=permanent need to be R=301?

For my error documents I have simple code as :

ErrorDocument 401 http://www.domain.co.uk/401.shtml

Will google recognise the 301 code ?

thanks

Will.Spencer
Jan 15th 2005, 8:15 pm
Here is what is working for me:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.internet-search-engines-faq.com(:80)?$
RewriteRule ^/(.*) http://www.internet-search-engines-faq.com/$1 [L,R=301]