Work@Microsoft    Study@UW.edu    Live@Seattle

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

3 Steps to Create a Random URL Redirection Page (Free of Charge)
4.5 (90%) 2 votes

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

<?php
$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';

shuffle($links);

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

header("Location: {$link}");
exit;
?>;

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

ftp://redirect.myhost.zone

  • 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.


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

Leave a Comment

Your email address will not be published. Required fields are marked *

Loading...
ScottGe.net