View Full Version : Auto re-direct with a twist.

05-05-2006, 03:04 PM

i have two domain names e.g one and two, one being the master. they both point to the same index page, in the same location as to where they are stored.

if you went to domain two, i want it to re-direct to domain one (master) automatically, i've tried using the refresh meta tag way, which works but it stays in a refresh loop, obvisously because it's accessing the same index page, is there away of just executing the redirect once, as i dont want to point each domain at a different page.

thanks in advance.

Bill Posters
05-05-2006, 03:42 PM
Your best and safest bet (from a search engine pov) is to use a server-side redirect such as a 301 redirect (http://www.tamingthebeast.net/articles3/spiders-301-redirect.htm) or equivalent (http://www.webconfs.com/how-to-redirect-a-webpage.php) to discreetly reroute requests for domain2 to domain1.

You'll need to establish domain2 with its own root directory structure first, then implement the 301 redirect method via the .htaccess file in the root directory of domain2.

05-05-2006, 03:45 PM
try this:-


header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.example-new.com" .



EDIT: Snap!

05-05-2006, 03:53 PM
thanks for that guys i'll have a look.