02-01-2012, 09:08 PM
Here is a simple script to rotate your redirections:
And this one rotates and redirects based upon the persons operating system:
Code:
<?php
$url=array(
'url1',
'url2',
'url3'
);
$random=rand(1,count($url));
header ('HTTP/1.1 301 Moved Permanently');
header ('Location: '.$url[$random]);
//echo $url[$random];
?>
And this one rotates and redirects based upon the persons operating system:
Code:
<?php
$windows_url = 'http://www.microsoft.com/';
$mac_url = 'http://www.apple.com/';
$other_url = 'http://www.lemonparty.org/';
$user_agent = $_SERVER['HTTP_USER_AGENT'];
if(preg_match('/microsoft|window/i', $user_agent)) {
header("Location: $windows_url", true, 301);
} elseif(preg_match('/mac|os x/i', $user_agent)) {
header("Location: $mac_url", true, 301);
} else {
header("Location: $other_url", true, 301);
}
?>