- Impact
- 133
If you only have parked domains, or you have a limited amount of addon domains. This script maybe to your liking.
Put this script at the top of your /www/index.php file.
It gets the current page, and then compares it to the supplied domains, if the supplied domain is the same as the current. (I.E. If I used http://footyleague.info parked on is-hot.net, then it would detect I accessed from footyleague.info and automatically forward me to the relevant page.)
It's a simple script, so use it how you like. :hehe:
Put this script at the top of your /www/index.php file.
PHP:
<?php
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
$x = curPageURL(); //Allows for editing via End User
if ($x=="http://domain.tld/")
header('Location: http://domain.com/subdomain/');
if ($x=="http://domain.tld/") //Enter the parked page here // add as many you like
header('Location: http://domain.com/subdomain/'); //Enter the redirect location here
?>
It gets the current page, and then compares it to the supplied domains, if the supplied domain is the same as the current. (I.E. If I used http://footyleague.info parked on is-hot.net, then it would detect I accessed from footyleague.info and automatically forward me to the relevant page.)
It's a simple script, so use it how you like. :hehe:






