Last active
December 16, 2015 16:18
-
-
Save fairlane57/5461762 to your computer and use it in GitHub Desktop.
Concrete5 development redirect based on IP. Useful if you want to redirect site visitors while in development - while allowing clients etc to review without registering or logging in. Just edit your root index.php file
This file contains 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 $allow = array("91.91.91.91", "92.92.92.92"); # Add allowed IP address | |
if(!in_array($_SERVER['REMOTE_ADDR'], $allow) && !in_array($_SERVER["HTTP_X_FORWARDED_FOR"], $allow)) { | |
header("Location: http://www.domain.com/whereveryouwant/index.html"); # your redirection url | |
exit(); | |
} ?> | |
<?php | |
require('concrete/dispatcher.php'); # allowed ip addresses will just see the site as normal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment