I have numerous domains and rather than create content for each one individually, I'm using the following code in each index.php page to display the relevan开发者_开发百科t page from another site I own (where 'getDomain' is a function for getting just the domain from a url):
<?php
$domain = $_SERVER['HTTP_HOST'];
$domain = getDomain($domain);
$crawl = "http://example.co.uk/page.php?domain=$domain";
$request = curl_init($crawl);
print curl_exec($request);
curl_close($request);
?>
Anyway, my questions are 1) is it reliable to use HTTP_HOST like this and 2) will search engine bots index my page or will they just get an error?
My hunch is that I'm better off entering the domain name into each index.php page - but I'd rather not have to do that!
Any help greatly appreciated!
This will work ok (and for search engines too), but can be realy slow... If you content and design not differs in diferent domains, better way is to configure normal web-server virtualhosts for that
精彩评论