#native_company# #native_desc#

Virtual Hosting in PHP

By Shawn White
on February 4, 2002

For those of you who host multiple sites on your server but only have one ip, and no dns server. Maybe your hosting on your home dsl line and using a third pary dns / ip based forwarding (such as DNS central) but you need the page requests redirected to different folders depending on what was typed in the browser address bar.
You also want the address in the browser to remain unchanged.

//Virtual hosting via php by Shawn White at [email protected]
//Free to use modify copy etc. If it helps you in someway a thank you email would be nice.
//Modify this array to add your own sites
//First elemement of the array is the site the
//visitor typed in addressbar, second element
//is where you //want to route them.
//leave out the http and www in the key(the first element)  - this is already dealt with
$homepageonly="no"; //this will may sure requests for any page other than the home page goes to the homepage anyway 

//Do not modify anything below this line!
foreach($websites as $key=>$value)
if($sitepos >-1)
			$cloc=$value . $extrapages;
}//end of foreach
if($sitefound=="false") header("Location:$defaultsite");