NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > CODE
Reload this Page Only got Parked Domains? Try This!

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.

Advanced Search
7 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 06-29-2007, 01:36 PM THREAD STARTER               #1 (permalink)
Danltn.com
 
Daniel's Avatar
Join Date: May 2007
Location: Danltn.com / Nottingham, UK
Posts: 1,201
Daniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond repute
 


Ethan Allen Fund Ethan Allen Fund

Only got Parked Domains? Try This!


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 Code:
<?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
????: NamePros.com http://www.namepros.com/code/344733-only-got-parked-domains-try-this.html
if ($x=="http://domain.tld/")
????: NamePros.com http://www.namepros.com/showthread.php?t=344733
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.
Daniel is offline  
Old 06-30-2007, 02:29 AM THREAD STARTER               #2 (permalink)
Danltn.com
 
Daniel's Avatar
Join Date: May 2007
Location: Danltn.com / Nottingham, UK
Posts: 1,201
Daniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond repute
 


Ethan Allen Fund Ethan Allen Fund
Update, this allows the user to load a different page. For example Domain.com would load domaincom.php homepage.

PHP Code:
<?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"]; 
????: NamePros.com http://www.namepros.com/showthread.php?t=344733
 } 
 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 
????: NamePros.com http://www.namepros.com/showthread.php?t=344733
  
?>
Last edited by Danltn; 06-30-2007 at 07:37 AM.
Daniel is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 03:52 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger