Thanks to Barry Goggin of PredictiveDomaining.com this post came sooner than expected. Barry is one of the individuals that brought the use of .htaccess (server side redirect) last week. After a few conversations via email I asked Barry if he was willing to share his knowledge on this topic, without hesitation he said yes.
We now have the trifecta of forwarding, pick the one best for your needs.
Forward and mask using GoDaddy
Forward using Redirect
And now .htaccess (server side redirect) by Barry Goggin…
Using server side redirects to mask affiliate links.
Redirects have many great uses when used properly. The most common uses are to forward old pages to new pages and to make sure that requests to www.yourdomain.com are forwarded to yourdomain.com or vice versa. Here we will learn how to use such redirects to mask affiliate links.
Why mask affiliate links?
There are three good reasons to hide affiliate link. Firstly affiliate links are ugly. I will use hostgator as an example. The affiliate link comes in the form:
http://secure.hostgator.com/cgi-bin/affiliates/clickthru.cgi?id=myID. Not pretty.
As Patrick said in a previous post, this is impossible to repeat to a person you meet in real life so that’s a second strike against it.
Thirdly people seem to rebel at the idea that the person showing the link would get paid for the click. So they will either abandon the effort or just navigate to the website directly by typing in the simple url or by searching in Google. All this results in loss of revenue for the affiliate.
What is .htaccess?
This tutorial is for Apache servers though other web servers use .htaccess also. In the root directory where you installed your website, you will find a file called .htaccess. It should also be in each of the directories of your website for security purposes.
You can access this file through an FTP program or through your website hosting company’s control panel. The first step is to make a backup of this file. Copy it to another directory or to your desktop and called it .oldhtaccess. Always back up a file before you make any changes so you can revert to the old file if needed.
Add the following lines if not already in the .htaccess file
Options +FollowSymlinks
RewriteEngine on
The first line above may not be needed but you can add it if you are having problems.
Options +FollowSymlinks
RewriteEngine on
Redirect 302 /hostgator
http://secure.hostgator.com/cgi-bin/affiliates/clickthru.cgi?id=myID
Now for each affiliate link, you add a third line as shown above. Redirect
302 is a temporary redirect which I think is the most appropriate for an affiliate link. The /hostgator is the link you will use on your web page and be able to tell people. It ultimately will be look like MyWebsite.com/hostgator where MyWebsite.com is the name of your website. The third string you will recognize as the ugly affiliate link which is where the person will be redirected to.
So it is as simple as that. For each affiliate, you add another line.
Remember to save the file after you have made the changes and make sure the file is in the directory where you created your website. Finally you create a link on your web page such as <a href=”MyWebsite.com/hostgator”/>
I recommend adding a “nofollow” tag to avoid any problems with Google and PageRank regarding affiliate link redirection. Here is an example: <a href=”MyWebsite.com/hostgator”
rel=”nofollow”/>
You can refer to this website for redirects on other platforms webconfs.com.
That was great, thanks again Barry Goggin of PredictiveDomaining.com for sharing that information. I truly love when a reader gets involved.




















One issue with the mask redirect… SSL becomes insecure. It is secure from the registrar to the site, but not from the end-user to to the registrar. Something that creates security issues. Something to think about. If a non-SSL site on the end I think ok, with a site that has SSL site I think this could be a security issue.
Andrew