How To Cloak Long Links On Your Website
Have you ever wondered how to cloak links with longer url’s or affiliate links on your website? It’s actually a pretty easy thing to do. There are a number of reasons you might like to do something like this. One way I used this method, was on my email subscription link. Instead of http://www.feedburner.com/fb/a/emailverifySubmit?feedId=677566, I gave the link a better appearance by cloaking it with this: http://antbag.com/go/email-updates. Either link will take you to the same destination, however the second both looks better, and it’s a much easier url to remember. You can also use this method for affiliate links which are usually long and generic, or any kind of links for that matter. Here’s how…
Step1
The first thing you want to do, is create a directory/folder on your server in the same directory your website is in. You can name it anything you want to call it. Mine is named “go”. Something like “recommends” works well with affiliate links. An example would be → http://antbag.com/go/hostgator. See how this works?
Step 2
Next, you need to create another directory inside the first one. Going back to my email subscription link as an example, I named the folder “email-updates”. Whatever you name this directory, it should be a name that relates to the destination of the link.
Step 3
In this step, you will open Notepad, or whatever basic text editor you have on your computer. Type in this code:
Once this is typed in, you will name this file index.php. You’ll notice the portion of the code that is written in CAPS. Follow those instructions and place the original url for your link there. If you’re using Notepad on a Windows PC, be sure that when you save, you name the file index.php, and change file type from .txt to All Files. This will enable you to save the file as a PHP file, rather than a text document.
Step 4
In the final step, all you have to do is open your FTP client(Filezilla, CoffeeCup, etc.) and upload this index.php file to the second directory you made. That’s it.
Recap
So if you named the first directory you created “recommends” and the second directory “ebay”, you would put your affiliate link to ebay in the index.php file in place of the part that’s written in all CAPS, save and upload to the “ebay” directory. Then the url http://yourwebsite.com/recommends/ebay would actually send your visitors to ebay through your affiliate link.

Thanks for the article! very informative, I’ll try it
This is great!
1. I market Click Bank products.How and what system of cloaking CB links would you use to cloak my Hoplink ID’s?
2. Does using index.php files work well for affiliate graphic hot links as well?
Thanks Mike Cooper
Yes, it doesn’t matter if you’re using a graphic or not, it still works because the graphic would still point toward the same url.
thanks for the post – interesting read
If you’re using WordPress, here’s a plugin that can make this much easier:
http://www.fergusweb.net/software/linkhopper/
Cool, thanks for the info. Personally, I would prefer to do it manually, because it’s not hard and I won’t have to worry about keeping another plug-in updated along with WP…but, that’s just me. I’m sure your plug-in will be helpful to many. Thanks again.
I dont really cloak my link much but i think there is also another program called wp ninja that helps to cloak .
I done some test and ads and i get more Clicks from non cloaked link than on cloaked links.
Or maybe i am just doing something wrong with my cloaking.
Anyways thanks for this article.
Thanks..thats a quick nice way to do it!
Thanks for your information..I’ve been trying for several affiliates that I follow .. I want to ask, whether we can build backlinks for cloaking?
Success for you..
This is not really ideal for backlinks. From what I understand, the best links pointing back at your site are targeted keyword links.
This information is great Anthony … I was just wondering how the URL on top also displays the link you created? for example you’re linking to a product through http://www.ethan.com/recommends/cool product, and the URL displayed at the product page itself also displays the same text. This would be terrific.
Smart link cloaker offers this type of script, but maybe there might be a way to manually do this, and would be free too
It very well may be possible, but I don’t know. I’m not sure how you would control the address bar readout once you get to the other domain. hmm.
cool that seems simple, will consider doing it in the future for some of my clickbank stuff
great ideas. I need to start learning technical stuff like this if i am going to suceed at internet marketing