Using .htaccess to Hide Affiliate Links

One of the best free ways to redirect your affiliate links is by adding a simple code into your .htaccess file.  This code allows you to link to a page on your website that doesn’t actually exsist and then redirect the user to your affiliate link or another site.

For example, let’s say you’re running an affiliate offer for online dating and you have built your landing page and on your site you’ve included links to several different sub-niches like asian dating, hispanic dating, etc.  So instead of linking to the affiliate offer directly so that others can see that they are being sent to an affiliate offer, you can instead send them to a url like http://www.yoursite.com/asian-dating and when they click on the link it will then redirect them through the affiliate url, thus increasing your CTR% (Click Thru Rate).

Adding this code is extremely easy and setting it up only takes a minute.  Simply open up your .htaccess file and add the following line to it.

redirect 301 /asian-dating http://YourAffiliateUrl

This code will then allow you to link from your landing page to http://www.yoursite.com/asian-dating and then redirect the user to the affiliate offer without them being aware of the affiliate link if they were to hover over one of your links.

You can add this line multiple times using each sub-niche by simply adding each one like this…

redirect 301 /asian-dating http://YourAffiliateUrl
redirect 301 /hispanic-dating http://YourAffiliateUrl
redirect 301 /black-dating http://YourAffiliateUrl

Another great benefit to using .htaccess to redirect your links is that you’re able to add those URL’s anytime in your articles and site and if you ever need to change the affiliate offer you’re using you can simply open up your .htaccess and replace one URL and it will reflect across your entire site!

So, quit changing all your links by hand and increase your CTR% by adding a quick and simple code to your .htaccess file!

In the next post, I will discuss using php to redirect and hide affiliate links which is another great, free method you can use that is very easy to setup as well!  Even if you have never used php or done any php programming.

Comments

  1. Vad says:

    Hi there,
    very strange, I did exactly what you say but nothing changed – the affiliate URL is still shown in the address bar?!
    Any ideas?
    Thanks
    Vad

  2. Derek says:

    Hey Vad, yes, in the address bar the link will still show, however, when people hover over the link on your site they will not see the affiliate URL, thus they will click though. This method also helps because alot of CPA companies send you through their own redirect URL which may look something like this…

    http://a.jump.com/A5efL

    However that URL may redirect to http://www.dating.com/id=123

    It basically helps avoid the detection of the user being sent to an affiliate offer, it won’t actually keep your URL in the address bar. Iframing an offer will do that, however, most companies don’t allow you to iframe their offers!

  3. Vad says:

    Nope, when I hover over the affiliate link it still see the aff link
    May be I did something wrong
    Thanks,
    Vad

  4. In your .htaccess file write the following line:

    redirect 301 /click-consultants http://www.clickconsultants.com

    Now, when you put a link on your page to http://www.yourwebsite.com/click-consultants … it will show that as the link on your hover, but when they click it, it will take them to clickconsultants.com

    A lot of sites use this with http://www.yourwebsite.com/go/affiliate.php to make it look more like a regular site like rather then an affiliate link.

    Good article Derek. I used to use a meta refresh in the header of a file, but recently switched over to 301 redirects as well.

  5. Derek says:

    Hey Vad, try adding this before the code in your .htaccess

    RewriteEngine On

    Let me know if that fixes it.

  6. Vad says:

    Hi Derek,
    I added it to no avail.
    Here is my htaccess file:

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress
    RewriteEngine On
    redirect 301 /Forex-killer http://vad111.andreaskir.hop.clickbank.net/?tid=CSFK

    I inserted the last line before and after # END WordPress but nothing changed.

    Is it save that I give htaccess file and other details to the public view?
    Thanks,
    Vad

  7. Grant29 says:

    Change up the order, make your .htaccess file look like:

    RewriteEngine On

    redirect 301 /Forex-killer http://vad111.andreaskir.hop.clickbank.net/?tid=CSFK [L]

    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

  8. Hi Vlad, I don’t believe anything in your code there is harmful to public view. Its just the basic wordpress htaccess codes and then your redirect.

    Can you pass along a link to the page you’re trying to use the redirect on so we can look at it and see if something is wrong there?

  9. Vad says:

    Thanks,
    this is the page:
    http://compare-forex.com/forex-killer-review
    Vad

  10. Derek says:

    Hey Vad the link http://compare-forex.com/Forex-killer redirects to your affiliate url, so it is working.

    Did you change the link on your main page to the http://compare-forex.com/Forex-killer? Or do you still have your affiliate link in the a href tag?

  11. Vad says:

    Yes I still have the aff link in the main page, should I change to “/forex-killer?”?
    Thanks,
    Vad

  12. Derek says:

    yes, you should change it to the URL that will redirect to the affiliate offer.

  13. Great tutorial and works like a charm. I’m especially impressed the fact that you are sharing such great tips, mainly because you see others trying to sell a simple script that does the same thing. Only for those you need to stomach through a 15 page sales copy. ;)

    Keep up the great work guys.

  14. Derek says:

    Well, first off, thanks for the comment, we try to bring you guys the best information possible! So make sure you subscribe to show your support!

    Secondly, some of those scripts actually cloak your links while using .htaccess won’t, although I’ve never seen the need to.

  15. So make sure you subscribe to show your support!

    Way ahead of ya. ;)

  16. affboy says:

    You may consider some free web tool.
    like: http://hide-affiliate-links.com/
    Even can encrypt the link.

  17. Kevin says:

    So Derek, do you just have a gigantic list of redirects in your htaccess file? Sorry I’m a newbie to affiliate marketing.

  18. I visit your website regulary. All your tips are excellent.
    Please keep those useful comments and suggestions coming !!

  19. htaccess redirect says:

    Personally I like using the PHP redirectional method to prevent any issues with search engines and my current SERPs.

  20. AffiliateMinded says:

    Thanks!

    This is a great quick way of setting up your links.

  21. kualahoo says:

    You can create a php file such as product.php, named anything you want, and contains the line:

    This will show as : http://yoursite/product.php

  22. Jes says:

    Hey, can you elaborate on the PHP redirection method and what are the issues with the search engines by using this .htaccess approach?

Trackbacks

  1. Share Results Blog » Blog Archive » Differences Between CPA and CPC Affiliate Mindsets says:

    [...] these posts on using .htaccess to hide affiliate links and using PHP to redirect affiliate links from the Click Consultants blog. Simply put, they outline [...]

  2. [...] or yoursite.com/merchant. The way most people I know do it is with HTAccess. Here’s how: Using .htaccess to Hide Affiliate Links | Click Consultants Affiliate Marketing Blog __________________ Your Partner in Success, Linda Buquet :: Affiliate Program Advertising, [...]

  3. [...] you don’t need to buy a program to redirect your affiliate links. Use HTaccess. Here’s how: Using .htaccess to Hide Affiliate Links | Click Consultants Affiliate Marketing Blog Hope this helps and best of [...]

  4. [...] Re: Can Someone Recommend a FREE Affiliate Link Cloaker? Why not just use htaccess? Here is how to do it. Using .htaccess to Hide Affiliate Links | Click Consultants Affiliate Marketing Blog [...]

Speak Your Mind

*