My custom redirection / link cloaking script

3 replies
Hi all,

I keep seeing here and there some threads asking how to cloak a link and / or redirect. Granted there are WordPress plug-ins for this, but not everyone uses WP and even if you do this may come in handy.

So here's my own custom script. With it you can define as many links as you like and even include a delay so the redirection is not instant.
Just put it on your own domain, call it whatever-you-like.php (but something not obvious... Don't call it redirect.php!), copy one of the links blocks and increase the index (so the next block in this example would be link[2] and so on), then load the script like this in your browser:

... Where dest is the destination - i.e. the link's index - and d a delay in seconds to wait before redirecting (useful when you don't want the redirection to be detected by a bot).

Note that each link block is made of 3 lines: the actual link, the title, and the picture (I added this one to be able to pin it on Pinterest). If you don't have a picture just leave that last one out.



//Links list

$links[0]['title']="14K White Gold, Round, Blue Diamond Stud Earrings";

$links[1]['title']="Royal Diamond Apple Green Shamballa Swarovski Crystal Stone Balls Shamballa Bracelet";

// URL variables
$destination = $links[$_GET["dest"]]['link'];
$title = $links[$_GET["dest"]]['title'];
$pic = $links[$_GET["dest"]]['pic'];
if(!isset($_GET["d"])) { 
} else {

echo '
<meta content="text/html; charset=ISO-8859-1"
if($no_redirect != 1)
echo '<meta http-equiv="refresh" content="'.$d.';url='.$destination.'" /> 

<p style="text-align: center; font-size: 18px; margin-top:  20px;">Your request is loading, please wait.<br>If you are not  redirected automatically within '.$d.' seconds, <a  href="'.$destination.'">click here</a>.</p>';
if(!empty($pic)) {
echo '<p style="text-align: center;><a href="'.$destination.'"><img src="'.$pic.'"></a></p>';
echo '</body>
} else {
echo '
<p style="text-align: center; font-size: 16px;">you are about to  take a $597 Internet Marketing video course... For $10! <a  href="'.$link.'">Click here.</a>.</p>

#cloaking #custom #link #redirection
  • Profile picture of the author Fahmzie
    Nice! Simple and handy script, thanks mate
    {{ DiscussionBoard.errors[6210205].message }}
  • Profile picture of the author OldLodgeSkins
    You're welcome.
    Do you use Facebook ? Then you can make money just by inviting people to a Facebook group ! It's called the Instant Income System. How cool is that?
    {{ DiscussionBoard.errors[6211555].message }}
    • Profile picture of the author rivox1

      Thank you for helping the community by posting this script. I found it very helpful!

      However, I am having a small issue with the script. I am working on a Mac and it works flawlessly on Safari, Chrome, and Firefox, however, I can't get it to work on ANY windows machine, (IE, Firefox, or Chrome)

      Do you have any idea of what may be causing this bug?

      I am using your script to redirect a page from adfly to its destination. The reason I'm using your script to re-direct to the final page is because I don't want my clients to see in their Google Analytics that the traffic is coming from adfly and by-pass me next time they want to order more traffic.

      If you want please tell me how I can make available to you the modifications (link, etc) I made to your script.

      I am immensely thankful for any help you can provide. Thank you in advance for your time and help!
      {{ DiscussionBoard.errors[6534435].message }}

Trending Topics