View Single Post
Old 09-13-2015, 02:55 PM  
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,078
Quote:
Originally Posted by klinton View Post
bump for working solution....
With what you had, change it up a touch and try this:

<?php

$urls[] = "";
$urls[] = "http://www.redirect1.com";
$urls[] = "http://www.redirect2.com";
$urls[] = "";

srand ((double) microtime( )*1000000);
$random = rand(0,count($urls)-1);

if(!empty($urls[$random]))
{
header("location:" . $urls[$random]);
exit;
}

?>

That way it should redirect into one of the other urls or drop into the page like normal. I would think that would work. Don't know what the SEs would think of it.

Edited in: I just dropped that into the top of one of my wife's blogs index.php and it worked fine. It does not give you the control by % but it does do the redirect. You could just do a little file read and keep track by counter of how many times you went to each url pretty easy to get that control.


.
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote