This redirect is for automated site launch. This particular site has a launch scheduled for Oct 31 11:30pm MST, the snippet uses unix time to check if it is past the launch time or not. Before the launch time all traffic that is not from the allowed IP address will be redirected to a landing page of your choosing.
Use the ref page to do your time conversions:
Use the ref page to do your time conversions:
<?php
//Timed Redirect
$visitor_ip = $_SERVER['REMOTE_ADDR'];
$current_time = time();
$launch_time = 1288589400;//Oct 31 11:30pm MST
$test_launch_time = 1288283536;//Change to whatever for testing
$ips_with_access = array('74.92.210.128','76.25.18.23');//IP's with access
if($current_time < $launch_time){
foreach($ips_with_access as $ips){
if($visitor_ip == $ips) $have_access = true;
}
if(!$have_access) header('Location: http://hyperspatial.com');//Redirect page
}
?>
