3 Steps to Create a Random URL Redirection Page (Free of Charge)

In this post, you will learn how to create a free webpage that randomly redirects to a list of URLs.   For example,

http://redirect.myhost.zone/link.php redirects you to one of the following web pages:


Step 1. Prepare a .php script file containing the following content

$links = array();
$links[] = 'http://devassistant.codeplex.com/downloads/get/1432900';
$links[] = 'http://devgallery.codeplex.com/downloads/get/1462910';
$links[] = 'http://devnews.codeplex.com/downloads/get/1463662';
$links[] = 'http://itnews.codeplex.com/downloads/get/1463672';
$links[] = 'https://qiniusdk.codeplex.com/downloads/get/1464813';
$links[] = 'https://qiniusamples.codeplex.com/downloads/get/1464815';
$links[] = 'https://opscms.codeplex.com/downloads/get/1464820';


$i        = rand(0, (count($links) - 1));
$link    = $links[$i];

header("Location: {$link}");

Put your links after ‘’$links[] = ‘.  For example, $links[] = ‘http://www.microsoft.com’;.  You can add as many links as you wish.

Save the file as “link.php” on your desktop.



Step 2. Register a free account on MyHost.zone

MyHost.zone provides PHP web hosting, free for lifetime.



Step 3. Upload the webpage

After you sign up a new account, you will receive an FTP address and credential to upload your webpages.   For example, my FTP address is


  • User name: redirec4
  • Password: <of course I cannot tell you Smile>

Here is what I get:


Next, navigate to the www folder, and upload the link.php file created in step 1 to the folder:



The webpage is live now! In my case, it’s http://redirect.myhost.zone/link.php.  In your case, you need to replace the ‘redirect’ sub-domain with your specified sub-domain in Step 2.

One thought on “3 Steps to Create a Random URL Redirection Page (Free of Charge)

Leave a Reply