I am trying to figure out how to do a replicating website application in such a way that many domains are pointed to one IP where the application is located, yet the PHP script would track which site it is and serve up their "skins" and content from their settings in a database. I have the application programming part down and have done site replication before, but I had to do the URL part like this:
http://www.mainsitedomain.com/ReplicatedSiteName/
I had a customer 404 error set up in which it would look for "ReplicatedSiteName" in a table and when it found it would redirect them to the application with session vars of their site id set. The problem with that is it is obvious to any visitors that it "is" a replicated web site due to the URL having www.mainsitedomain.com in it all the time. I need a way for the site to be referred to as http://www.ReplicatedSiteName.com the whole time yet it is hitting the same application located at the IP of the domain “mainsitedomain.com” and PHP is able to track which replicating website is which. Also, "frame forwarding" is out of the question due to the search engine handicapping this would produce for each site.
The direction I started going with this was to have PHP check the CGI var "SERVER_NAME" on every page hit and it would pull check for "ReplicatedSiteName.com" in a table and serve up their content. The problem is I started testing this variable on a site that has 1 main domain "ThisSite.org" and 2 other domain "parked" there also "ThisSite.com, ThisSite.net." When I tested what the CGI var returned by going to the site from the .com and .net domains the "SERVER_NAME" always came back as "ThisSite.org" regardless.
I have seen other site offer this type of service and they "seem" to be doing it similar to how I am describing, unless they are making a "copy" of their replicating software and database every time and dropping it into another virtural directory (which would also be out of the question for me.)
I am mainly a coder and know little about server administration subjects. Could someone give me any ideas how to "pull off" this effect in this or some other way?
Thanks.