...

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



Kal
05-05-2006, 02:04 PM
hi,

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, 02: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.

jonnybinthemix
05-05-2006, 02:45 PM
try this:-


<?php

header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.example-new.com" .
$_SERVER['SCRIPT_NAME'] . '?' .
$_SERVER['QUERY_STRING']);
exit();

?>

Jon

EDIT: Snap!

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum