Created
May 17, 2017 11:31
-
-
Save BHWD/c8c44f2820359f842d6053128160c37d to your computer and use it in GitHub Desktop.
Redirect users based on IP. USeful for hiding websites from clients
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$visitor = $_SERVER['REMOTE_ADDR']; | |
if (preg_match("/192.168.0.1/",$visitor)) { | |
header('Location: http://www.yoursite.com/thank-you.html'); | |
} else { | |
header('Location: http://www.yoursite.com/home-page.html'); | |
}; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment