Skip to content

Instantly share code, notes, and snippets.

@alwerner
Last active October 12, 2015 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alwerner/4082871 to your computer and use it in GitHub Desktop.
Save alwerner/4082871 to your computer and use it in GitHub Desktop.
php conditional loading based on host
<?php
if ($_SERVER["HTTP_HOST"] == 'mydomain.com' || $_SERVER["HTTP_HOST"] == 'www.mydomain.com' ) {
// insert, for instance, analytics code here.
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment