How to Make a Redirect for Affiliate Links
Yesterday I got an email from a friend asking how to make an affiliate link look “clean”. If this very experienced blogger was asking the question, then chances are, there are many of my readers that would like to know too.
WHY WOULD I WANT TO SET UP A REDIRECT?
When you sign up with an affiliate program, the program has to give you a unique line of code that can be tracked so that you can get proper credit for the leads or sales that you generate from your site to theirs. In most cases, this means the link you are assigned will be long and drawn out, a combination of letters, numbers and symbols, and it will be long. For many users, if they mouse over such a monstrosity, they will not even click through for fear of the unknown.
Another reason you may want to use redirects with affiliate links has to do with managing them. Let’s say you sign up as an affiliate to program XYZ and you link to your affiliate link in dozens of blog posts. Then, one day the affiliate manager changes your affiliate link. You now have to go back through all of those links and change them. However, if you had set up a redirect, you could change it in one place and all the links would be routed correctly.
HOW DO I SET UP A REDIRECT?
Setting up a redirect is a fairly simple process. Basically you have to create a new php file that will contain the affiliate link and some additional code, save it with a unique name, and use the new file name when referring to that affiliate link.
1. Open Notepad or your favorite code editor
2. Type in the following code as you see it below, replacing the red text with your affiliate link.

3. Save the file as keywordxyz.php (you come up with a file name that makes sense)
4. Upload the new php file to your web server (Need help with FTP? Check out my FTP Tutorial)
5. When linking to your affiliate link, you can now use:

I find that using redirects helps me stay more organized and I don’t have to go hunting for my affiliate links everytime I want to use them.
As it is with everything in the web development world, there is usually more than one right way to do everything. There are other ways to set up redirects, but I have found this method to be the easiest to set up and keep track of.
Related articles:
- Tutorial: FTP - Its Easy As 1-2-3
- 6 Easy Steps to Making a Web Hosting Switch
- My 13 Favorite WordPress Resources
- 13 Steps to a Blog Redesign
- Website Monetization - A Reality Check
Posted on: Tuesday, October 2, 2007 at 8:46 am
Contributors. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
