$urls = array("http://yourUrl/landingpage1.html", "http://yourUrl/landingpage2.html");
header("Location: " . $urls[rand(0,count($urls)-1)]);
// read the next number
$number = intval(@file_get_contents('file_path')); // write a number to this
$urls = array("http://yourUrl/landingpage1.html", "http://yourUrl/landingpage2.html");
header("Location: " . $urls[$number % (count($urls)-1)]);
// now write (number+1) to a file
$fh = fopen('file_path', 'w');
fwrite($fh, ($number+1));
fclose($fh);
Much more elegant than the one I would have done.This will split test any number of pages uniformly (on a large enough scale). Read more about rand if you want....PHP:$urls = array("http://yourUrl/landingpage1.html", "http://yourUrl/landingpage2.html"); header("Location: " . $urls[rand(0,count($urls)-1)]);