page custom to url
Moderator: General Moderators
page custom to url
say you have two domains pointing to the same index.php page - is it possible to detect which domain the user is loading and display the homepage customized for each domain? examples?
You should be able to look at the $HTTP_HOST or ($_SERVER["HTTP_HOST"]) variable to determine which url they are coming from.
Code: Select all
<?php
if ($_SERVERї"HTTP_HOST"] == "www.abc.com")
{
//Display content for abc.com
}
elseif ($_SERVERї"HTTP_HOST"] == "www.xyz.com")
{
//Display content for xyz.com
}
?>