PDA

View Full Version : Redirecting a whole site via .htaccess


SEOMalc
07-12-2006, 06:38 AM
Hi,

sorry if this is posted in the wrong place.

I have a client with 2 domains i.e. onetwothree.com and ott.com which both point to the same files on the same server.

I want to redirect any request for a onetwothree.com page to the corrisponding ott.com page i.e. onetwothree.com/blah/blah.html to ott.com/blah/blah.html

I have read about this but just wanted to check, is the solution to write the following into .htaccess in the root;

redirect 301 / http://www.onetwothree.com/ http://www.ott.com/

I'm not 100% sure about the http:// bits but am unable to test due to not having access to the clients site.

Many thanks

Malcolm.

seomike
07-12-2006, 10:55 AM
RewriteEngine On
RewriteBase /

Rewriterule ^(.*)$ http://www.ott.com/$1 [R=301,L]

put this on the root htaccess file in www.onetwothree.com it will do the trick ;)

SEOMalc
07-12-2006, 11:20 AM
Many thanks for that seomike, for my own personal education would my solution have worked or is it fundamentally flawed ?

Malcolm

SEOMalc
07-12-2006, 11:35 AM
Possible problem, my client also has online.ott.com which points to the same files and doesn't want to be redirected.

Am I right in thinking the solution you have suggested also causes this to be redirected to www.ott.com.