If you’re an affiliate for anything then you’re certainly familiar with those long, ugly affiliate links the tracking software uses. They usually look like this: http://c0b870yjr2s6yb4cxj4gp8vzgg.hop.clickbank.net/
Yuck. It doesn’t exactly make your reader feel safe and secure when she’s about to click and sees that monstrosity pop up in her browser’s status bar. What you want is a nice, pretty link. I was shocked recently to find out just how many people don’t know how to cloak an affiliate link without the help of a plug-in or shortening service, so I put together a little tutorial for you.
First, grab your affiliate link. We’ll use that ugly Clickbank link up there for demonstration. Next, open up a text document (Notepad works great for this – no need to get fancy) and type
< ?php header( 'Location: LINK' ) ; ?>
Replace LINK with your affilaite link, like this:
< ?php header( 'Location: http://c0b870yjr2s6yb4cxj4gp8vzgg.hop.clickbank.net/' ) ; ?>
Now, click “save as” and save the file somewhere on your hard drive (I save mine to the desktop so I can find it). Name it “index.php” without the quotes.
Using your favorite FTP program, or directly through the file manager on your cPanel, you’re going to create a directory (folder) in your root directory. Call it likes, or recommends, or something of that nature. Then inside that directory, you’re going to make another folder, only this time you’re going to name it after your product. So in this case, I’d name the new folder illusionmage, because that’s the name of the product. (I’m not endorsing that, by the way. It’s just the first thing listed on Clickbank today.)
Now upload your new file, index.php, to your product folder. Close your FTP program, open your browser, and in the address bar, type http://yourblogaddress.com/likes/illusionmage (replacing the pertinent info with actual info from your blog, of course). You should automatically be redirected to the sales page for the product you’re promoting.
Congratulations! You’ve just made your first manual redirect! You can use the much more attractive link anywhere you’d normally use your ugly affiliate link, even in conjunction with banner ads and other promotional materials you get from the vendor.
Now I know you’re sitting there thinking, why go to all this work when I can just get a plug in to do it for me? Or use Bit.ly?
True, it’s a lot faster (though not much, after you’ve had some practice) to let a plug in or URL shortening service handle the heavy lifting for you, but here’s why you don’t want to do that: You’re giving up control.
Imagine if you publish a blog for years, and it’s full of affiliate links all using bit.ly for cloaking. What happens if bit.ly goes out of business? You’ll be spending weeks tracking down broken links, that’s what. And don’t think it won’t happen. Remember tinyurl?
Or what if you rely on a plug in and the developer stops updating it? Eventually it’s going to stop working. Same problem. You’ll spend weeks trying to fix all your broken links, and be missing loads of sales while you track them all down.
Better to do things right from the start, and to keep control of your own links.
There are lots of methods to cloak affiliate links. This one is my favorite, but I’d love to hear yours. Share with me in the comments!
NOTE: WordPress doesn’t seem to like to embed code, so if you’re having trouble copying and pasting those bits up there, you can download the text file here: Redirect.zip








Thanks for sharing your method. I agree, it is a little more work to cloak your links and upload it to your site, but it looks much more professional and I think it can also help your click-through rate.
I use ProfitProtector to cloak my affiliate links and find it very easy to work with. You just insert your affiliate link, name the redirect page and save as html. Your affiliate ID never shows up, no matter how many other pages you visit on a site.
Thanks for the download, always good to try out another method too.
Hi Elsie,
I don’t cloak every link (too much work on an Amazon affiliate site, for example) but I do think it’s a good practice. And once you’ve done it a few times, it becomes second nature.
I hadn’t heard of ProfitProtector. I’ll definitely check that out. Thanks!