How to Hide your Affiliate Links Using .htaccess
In the last post, we talked about how to use a PHP redirect and an HTML redirect in order to hide your affiliate links. Those are some fantastic ways to go about it, but they also have some downfalls.
Here is another way you can hide your affiliate links:
Using a .htaccess 301 Redirect
**BEWARE** Don’t go messing around in your .htaccess file. Just do what you need to do, save, and upload.
First, go through your FTP and find your .htaccess file. (If you don’t have one, you may need to create one. Fantastico WordPress installs will always have one.)
Download it and open it up using Notepad.
You may see some code and markup you are unfamiliar with. Just go to the blank lines underneath it, hit enter a few times, and begin with the following code.
A 301 redirect tells the search engines that the page has moved, and to find it’s new address at the place you link to. It’s like snail mail forwarding or e-mail forwarding.
On a blank line on the .htaccess file, type the following:
redirect 301
That’s what we will use to start the redirect.
Next, think of a fake page name for what you want the redirect to be. For this example we’ll link to Niche Titans. So, we’ll make up a fake page name called: niche-titans.php So, add: /niche-titans.php to the redirect. It should look like this:
redirect 301 /niche-titans.php
You DO NOT need to have a /niche-titans.php file on your server for this to work.
Lastly we will add the site we are linking to (your affiliate link).
redirect 301 /niche-titans.php http://nichetitans.com
Now, save and upload the file back to your server.
Now, if you create a link to: http://your-website.com/niche-titans.php it will automatically direct anyone who clicks on the link to http://nichetitans.com … Easy, huh?
This will give you control over the link people see in the status bar, and yet another way to hide your affiliate links for your niche sites.
Hope this helps!
How to Hide Your Affiliate Links using a PHP or HTML Redirect
Using a PHP redirect or HTML refresh to hide your affiliate link is something you should get in the habit of using. A redirect that masks your affiliate link is extremely important when running an email marketing campaign and your sponsors usually request that you do so to prevent their links being marked as spam.
Here are the basics:
1. How to Setup a Domain Redirect
Example: http://mymassagecareer.info/
All you do after you purchase the domain is host it on your webhost and change it to redirect to a different URL. This will redirect to one URL and only one URL.
2. How to Setup a PHP Redirect
Example: http://usenet-tutorials.com/nichetitans.php
This is all the code you need:
<title>nichetitans</title>
<?php
header( ‘Location: http://nichetitans.com/how-to-hide-your-affiliate-links-using-php-or-html-redirects/’ ) ;
?>
This will redirect directly to the URL specified in (‘Location:http://domain.com/‘) and this is all the code you need in the .php file. Literally copy and paste this code, change the URL and save as a .php. Once you’ve done that all you need to do is upload it to your web host and type in the URL as you created it, for example: hxxp://domain.com/nameofphpredirect.php
3. How to Setup a HTML Refresh Redirect
Example: http://googlegivesmecash.com/google-money-tree.html
<html> <head> <title>Google Money Tree</title> <META http-equiv=”refresh” content=”1;URL=http://www.adsjmp.com/track.asp?a=CD4613&b=14193&d=0&l=0&p=0&o=”> </head> <body bgcolor=”#ffffff”> <center> </center> </body> </html>
This is the exact code you need in the .HTML and the only code you need. Just copy and paste this code in to a new document, change the URL=http://domain.com/ and save it as a .HTML. Once you’ve done this all you need to do is upload the redirect to your webhost and type in the URL as it was created, for example: hxxp://domain.com/nameofredirect.html
These are the easiest ways to hide your affiliate links. So which one of these methods is the best? The answer is it really depends on what you’re using it for and what you need to accomplish.
1. Using a Domain Redirect
- This is best if you want something short and easy to remember.
2. Using a PHP Redirect
- This is best if you want to redirect to another page quickly without the target affiliate link showing up in the address bar like it may if you’re using an HTML refresh.
3. Using a HTML Redirect
- This method is best if you don’t want your affiliate sponsor to see where your traffic is coming from and can be quite effective in hiding your landing page. It basically pauses for the amount of time you specify and enters the exact URL in to the browser.
Easy and Effective – I hope this everyone hide their affiliate links if they aren’t hiding them already!






