Dynadot โ€” .com Registration $8.99

Only got Parked Domains? Try This!

Spaceship Spaceship
Watch

Daniel

Danltn.comVIP Member
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.

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:
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Update, this allows the user to load a different page. For example Domain.com would load domaincom.php homepage.

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://recentfootynews.info/") // Enter the parked domain
header('Location: http://domain.com/subdomain/'); //Enter the page you want to redirect to if using forwarder otherwise // it.
include 'simple.php'; //if you want different content instead of normal then include it, otherwise // it. (This will load simple.php, which can be a fully-fledged php/html page.)
exit; //This stops the rest from loading

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 
  
?>
 
Last edited:
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Domain Recover
DomainEasy โ€” Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back