Get all new articles directly to your inbox!
Dealer Dan, pictured here with WWE Superstar Mick Foley, has been in internet marketing since 1996. He likes hugs, long walks on the beach, and making money while wearing his jammy jams. For more information, you can read all about Dealer Dan. » General & SEO Affiliate Guide » How To Redirect Affiliate Links

How To Redirect Affiliate Links

I’ve you’ve heard about redirecting affiliate links but are unsure as to the benefits of redirecting affiliate links, then please read my article: Why You Should Redirect Affiliate Links.

If however, you already know why you want to redirect affiliate links and are wanting to know how to redirect affiliate links then you’ve came to the right place.

How To Redirect Affiliate Links

There are a variety of options for you when it comes to redirecting affiliate links – the majority of them being extremely easy. There’s really no one “best option” so I’m just going to list here as many options as I can think of when it comes to redirecting affiliate links.

I’ll use Affiliate Bible as an example for all of these. Instead of seeing the affiliate link in every case, you would be seeing where affiliate-link.php redirects to that affiliate link.

ie: will redirect to:

(Quick note: Often affiliate links will resolve to the domain name. If you click the link above you will see that you ultimately end up at with no evidence of the affiliate link in the address bar. The affiliate links are still working – don’t worry. They’ve just now inserted a tracking cookie and made their site/landing page look more user-friendly).

Use .htaccess to Redirect Affiliate Links

This is a very popular one. You most likely have an .htaccess file in the root directoy of your domain. You can use this to redirect URLs from one URL to the other. So if you moved domains, you could redirect all your webpages from one domain to the other.

You can also use this to redirect affiliate links. Using Affiliate Bible as an example above, here’s how I would have my .htaccess file:

redirect 301 /go/hostgator.php
redirect 301 /go/focal-click.php
redirect 301 /go/godaddy.php
redirect 301 /go/slotland-affiliates.php

And that’s how you redirect affiliate links using .htaccess. As you can see you don’t need to put them in any particular order, so you don’t need to worry about putting them in alphabetical order or anything like that. If you ever need to update an affiliate link, you simply edit your .htaccess and replace the old affiliate link with the new one on the particular line.

Use Meta Refresh to Redirect Affiliate Links

This is a very simple one which you can use with .html files. You could also do it with .php files but there’s no point when there’s a much simpler PHP redirect(see next entry on this list). I’ll give you a step by step guide – let’s say we were going to do the hostgator example I mentioned:

1: Create the directory you want affiliate links to go in on your server. ie: /go/ (only have to do this once)
2: Open up notepad or equivalent, and paste the following text into a blank text file:

(I’ll explain that code in a second – click for big)

3: Save the file to your computer as hostgator.html for example.
4: Upload the file to your server in the required location ie: /go/.

That’s it. Now when you visit /go/hostgator.html it will automatically forward the visitor to the affiliate link. If the affiliate link changes, you simply update the URL in that particular file.

Now just to explain that code. The “META” tag is the important one. That tells the web browser that upon visiting that URL, it should immediately “refresh” the browser, and send it to the URL mentioned. Content=” basically means do it in 0 seconds, aka immediately.

The TITLE tag is not required, but I like to include it anyway. If the user happens to glance up at the title of the tab they’ll understand immediately that they’re being redirected. The BODY tag also isn’t really required either, but you might prefer for them to see a black background or similar when they click an affiliate link so I added that in.

If you wanted to do redirects in a folder style – ie: would forward to hostgator, then I’d recommend not doing this method. If you were to do that refresh via this method, you’d have to create a folder called “hostgator” in your root directory. You would then put the above code in a text file as normal, but save it as “index.html” or “index.php” and upload it to the /hostgator/ folder.

Using a PHP Redirect to Redirect Affiliate Links

While the Meta Refresh works in php files, I’d much rather use a simple redirect if using php files. All you would need to do is create a file called hostgator.php and then put this text in it:

And that will redirect hostgator.php to the affiliate link.

Use a Plugin to Redirect Affiliate Links

If you’re using a content management system, there are a variety of plugins you can use to redirect affiliate links. It depends on the CMS that you are using of course, and I’m not going to cover every CMS. Just google “______ Redirect Plugin” where the blank is whatever content management system you are using and you’ll find a variety of options.

Other Methods to Redirect Affiliate Links

There are a few other methods to redirect affiliate links, but the above 3 are basically the most commonly used, and the ones I would recommend.

Using a PHP Jump Script to Redirect Affiliate Links

This is one other really popular method that some websites use, and I felt I should mention it here. It’s involved creating just one php file where you can add a variable at the end to redirect the user.

Lets say I created for example(this doesn’t exist – please don’t attempt to index it Google!). When I link Hostgator, the link would be or if I linked Cake Poker, the link would be Poker.

To do that, I’d create the file visit.php in notepad, and have this text in it:

(Click for Full Size)

Line 2 basically says if the text variable isn’t within the php file, to send them to the homepage. You can play around with all of this too to better suit what you want. You may want to call the file go.php for example, and then change $v to $go.

And Remember:

Once you have set up your redirection links, be sure to use robots.txt to block Google from following or indexing the affiliate links.

Get all new articles directly to your inbox:
This article, as are all articles on, was written by Graeme aka "Dealer Dan". Graeme currently resides in Kingston, Ontario and has been running his own internet marketing business since 1996.

This article was written on January 21, 2012 however all articles are looked at on a monthly basis and updated to keep them relevant.

If you need to contact Graeme, please see his Contact Page. If you are an affiliate manager wanting promoted please see this page.