I've got this bit of php code for parked domain situations, that will "read" the url in the browser and perform different tasks depending on what url was used to get somebody to the site. Here's the coded:
<?
if(preg_match("/domain1\.com/i", $_SERVER["HTTP_HOST"])) {
(((code for choice #1)))
if(preg_match("/domain2\.com/i", $_SERVER["HTTP_HOST"])) {
(((code for choice #2)))
} else {
(((code for choice #3)))
}
?>
Since I'm a newbie I don't really understand HOW this code actually works but I've got a couple of questions for anybody who does understand it:
1) I use this code on a dual domain website of mine. It's all the same content but I use it to load a different header/footer and different color scheme depending on what domain got you there. But why would this code not work to host multiple sites (different content) on your servers by just by parking multiple domains and parsing this code on the index page and loading up the appropriate content for that domain?
2) What will the site do for a search engine spider like Google since it's not a browser? Will it get it right and load up the appropriate code for that domain, or will it not work and always go to the "else" statement?
Thanks for the help!