Jump to content

markfresh

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

markfresh's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. 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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.