These codes are useful for hiding the affiliate links. However, please read the affiliate program terms of service, so that you won’t go against it.
For all except the last way (.htaccess redirect), create the respective file for each affiliate link with the code for the chosen redirect style. Replace ‘http://your-affiliate-link-goes-here’ with the URL of the affiliate link.
For example, if you choose to use the PHP redirect, first create a PHP file. Copy and paste the PHP redirect code into that file. Replace ‘http://your-affiliate-link-goes-here’ with the affiliate link URL.
Every time you want to link to the affiliate link, just link to that file.
You have to create new file for each affiliate link.
- HTML redirect
- PHP redirect
- ASP redirect
- ASP.NET redirect
- Coldfusion redirect
- JSP redirect
- cgi Perl redirect
- Ruby on Rails redirect
- Apache .htaccess on Linux
1 2 3 4 5 6 7 8 9 10 | <html> <head> <title>HTML Redirect</title> <meta http-equiv="refresh" content="0; url=http://your-affiliate-link-goes-here"> </head> <body> Please wait. Redirecting... </body> </html> |
1 2 3 | <?php header("Location: http://your-affiliate-link-goes-here"); ?> |
1 2 3 4 | <%@ Language=VBScript %> <% Response.AddHeader "Location","http://your-affiliate-link-goes-here" %> |
1 2 3 4 5 6 | <script runat="server"> private void Page_Load(object sender, System.EventArgs e) { Response.AddHeader("Location","http://your-affiliate-link-goes-here"); } </script> |
1 | <.cfheader name="Location" value="http://your-affiliate-link-goes-here"> |
1 2 3 4 | <% response.setHeader( "Location", "http://your-affiliate-link-goes-here" ); response.setHeader( "Connection", "close" ); %> |
1 2 | $q = new CGI; print $q->redirect("http://your-affiliate-link-goes-here"); |
1 2 3 | def old_action redirect_to "http://your-affiliate-link-goes-here" end |
Add this code to the end of .htaccess file. Replace ‘http://your-affiliate-link-goes-here’ with the affiliate link URL. To have more than one affiliate link, just add another RewriteRule.
1 2 | RewriteEngine on RewriteRule ^affliate.php$ http://your-affiliate-link-goes-here [R] |
Related Articles:
Popular Articles:
- Backup folders with 7-zip command line
- Insert figures to LaTeX
- Create LaTeX table easily
- Add personal signature to Lotus Notes 7
- Windows XP Service Pack 3 Final release download
Spread/Promote this article.
Digg | Del.icio.us | Stumble | Y! MyWeb | Y! Buzz | Fave It! | RedditSubscribe for free.
Subscribe to Selinap.com feed right now!
Tags: affiliate, apache, asp, cfm, html, jsp, perl, PHP, ruby, WordPress

The question is WHY would you want to hide the affiliate link? I’m sure there is a good reason, but it escapes me.
Nice Blog Design, whre i can get this theme
kiprams last blog post..Cara Gampang Mengalahkan SEO Master
I design it myself.
Jeff: It is not the matter why we should hide the affiliate links. What important is that we could do it.
Jeff: what would you do if you found the link you’ll be redirect is affiliate link?. that’s the answer for your question.
i don’t remember the name, but there’s a wordpress plugin that can hide the aff links, and it works.
i always use iframe to cloak my affliate link. then i encrypt the code so when they view the source, all they see is just the code.
[...] also has write a nice tutorial on How to Hide affiliate link. You might be interested to read the 9 ways to hide affiliate links tutorial by Selinap. Subscribe to comments Comment | Trackback | Post Tags: affiliate program, [...]
Don’t forget to mention that PHP redirectional scripts work just has good as actual redirect codes.