Forum Moderators: phranque

Message Too Old, No Replies

htaccess 301 Solution

         

PaulHudson

11:43 am on Dec 11, 2007 (gmt 0)

10+ Year Member




System: The following message was cut out of thread at: http://www.webmasterworld.com/uk_ireland_search_engines/3448369.htm [webmasterworld.com] by engine - 3:07 pm on Dec. 14, 2007 (utc 0)


Hello,

I have a dedicated server with 1and1 which as you say is in Germany. Hence I would like to change to .co.uk.

Would a site wide 301 redirect be ok for this?

I was thinking of the following in my .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine on

RewriteCond %{HTTP_HOST} ^www.example\.com$ [NC]
RewriteRule .* http://www.example.co.uk/ [L,R=301]

RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule .* http://www.example.co.uk/ [L,R=301]

example.com currently has a unique IP which I would now point to example.co.uk.

I presume the best way of doing this is:

1, Switch IP address of example.com to example.co.uk
2, Move site to example.co.uk vhost dir
3, redirect example.com and www.example.com to www.example.com as above

Paul