Make sure your affiliate links link to a page on your site that in turn redirects to your affiliate link. DO NOT DIRECTLY USE AN AFFILIATE LINK. Why not?
The reason for this is four fold:
It’ll save you from wanting to murder people
If you ever need to change an affiliate link from a merchant, you want to globally change all pages that use that affiliate link. If you use the affiliate link directly on every page, you will need to go to every page that includes that link and manually change them (and if it is in 300 places you’ll want to tear your hair out). If you link to a page on your site that redirects to your affiliate, you only need to change the affiliate link in one place and it’s easy peezy.
It’ll protect you from prying eyeballs
The merchant that you’re affiliated with won’t be able to see the referring url for the link. This protects you because it prevents your merchant from seeing what piece of content is the most potent in terms of converting users (because they could try to copy that content to illicit the same result).
It’ll keep your urls nice and clean
Your affiliate link urls are cleaner and more indicative of their purpose. Because, sometimes, the url of an affiliate link will link to an affiliate network like shareasale.com.
It’ll make your brain work less
Rather than having to remember or keep track of all of your different affiliate links, all you have to remember is the name of the merchant that you’re using. For example, our affiliate link to WPEngine’s hosting is http://blog.wplauncher.com/wpengine. This is a lot easier to recall than the actual link which is http://wpengine.com/plans/?SSAID=988896&utm_source=SAS&utm_medium=394686&utm_campaign=988896.
There are 2 methods to accomplish this that are pretty easy
Change the htaccess file
Redirect 301 /dreamhost http://www.dreamhost.com/r.cgi?1240706
Create a separate file
You first create a directory in the main site directory of your WordPress site or the web accessible directory of a different site. If your site uses PHP - create an index.php file that does the redirects and place that in the directory.
In that php file put the following code:
<?php header( 'Location: http://www.dreamhost.com/r.cgi?1240706' )