FatalBreeze
07-18-2007, 08:48 PM
Hello!
I'm considering to buy a new domain name for my website, the existing domain is atraf-f.net and i want to buy atraf-f.com (for example).
But in still want the keep the old domain, so that when someone enters atraf-f.net/forumdisplay.php?f=15 he will be redirected to atraf-f.com/forumdisplay.php?f=15.
I've built a tiny code, and i want to know whether it would work or not, can you tell me please?
if(stristr($_SERVER['SERVER_NAME'],"net")) {
$dir = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$dir = str_replace("net","com",$dir);
$dir = "http://".$dir;
header('HTTP/1.1 301 Moved Permanently');
header("Location:$dir");
}
the code will be placed in global_start.
Will it work? Thanks!
c'mon? surely someone must know this...
I'm considering to buy a new domain name for my website, the existing domain is atraf-f.net and i want to buy atraf-f.com (for example).
But in still want the keep the old domain, so that when someone enters atraf-f.net/forumdisplay.php?f=15 he will be redirected to atraf-f.com/forumdisplay.php?f=15.
I've built a tiny code, and i want to know whether it would work or not, can you tell me please?
if(stristr($_SERVER['SERVER_NAME'],"net")) {
$dir = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$dir = str_replace("net","com",$dir);
$dir = "http://".$dir;
header('HTTP/1.1 301 Moved Permanently');
header("Location:$dir");
}
the code will be placed in global_start.
Will it work? Thanks!
c'mon? surely someone must know this...