Hi
I apologise if this is basic but I have been looking around to see if I can find a solution. . I would like a message to appear if someone has arrived at my site not using the main URL but via one of the redirects I have in place. Now the following works
<?php
$mainurl = ($_SERVER['HTTP_HOST']);
$main = "www.mywebsite.co.uk";
if ($mainurl!=$main) {
echo "Hi, the main website is www.mywebsite.co.uk, you have come via ".$_SERVER['HTTP_HOST'];
}
?>
but how do I say if the main url does not equal "www.mywebsite.co.uk" or "mywebsite.co.uk" then echo? I would have thought that
<?php
$mainurl = ($_SERVER['HTTP_HOST']);
$main = "www.mywebsite.co.uk";
$main2 = "mywebsite.co.uk";
if ($mainurl!=$main || $mainurl!=$main2) {
echo "Hi, the main website is www.mywebsite.co.uk, you have come via ".$_SERVER['HTTP_HOST'];
}
?>
but that doesn't seem to work, any help appreciated
thanks
Mark