Lets Talk Affiliate Redirects Part1

It seems that many, many Internet Marketers are still not properly using redirect methods which protect against search engine penalties.

I will address redirects in a a few ways, because there is not a one size fits all method of dealing with all cases.

The basic laws of linking to affiliates

1. All legitimate traffic MUST get too the product page.

2. Links shouldn’t ever be traversed by search engines (The search engine should not be able to tell what the landing page/site of your links are).

3. Its almost always better to make it look like an affiliate link is really just MORE CONTENT on YOUR site which you don’t want crawled/indexed.

Following these three rules will allow you to go from looking like a spammy site, to an reading like an independent voice for the product your are trying to sell (provided you can get around duplicate content filters). It is more or less a one-eighty from the SEO perspective.

Using robots.txt

The robots.txt is a text file which you put in the root directory of your site, which tells which directories should NOT be crawled. The syntax is pretty trivial for our cases.

Example robots.txt

User-agent: *
Disallow: /info/
Disallow: /bikes/
Disallow: /af/
Disallow: /zaf/

Putting this in http://yoursite.faux/robots.txt will disallow the directories http://yoursite.faux/info/, http://yoursite.faux/bikes/, etc … from being crawled. If they do get crawled you have the right to slap 403 forbidden for the wrong user agents.

NOTE: these folders do not have to actually be on your server at all. We will use mod_rewrite to take care of pairing the links as shown on your site with the affiliate landing page.

mod_rewrite is standard on most Apache webservers and is a very powerful tool if you take the time to learn it. I will just show some very basic examples here.

Example .htaccess

<IfModule mod_rewrite.c>
 
RewriteEngine On
RewriteBase /
 
# Redirect http://example.com/info/foo.php to
# http://dfhu.org/landing.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^info/foo.php http://dfhu.org/landing.php [R,L]
 
# Redirect any request for any file in /bikes/ to
# http://dfhu.org/bikes.php?myid=44
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^bikes/ http://dfhu.org/bikes.php?myid=44 [R,L]
 
# Append the file name as the value of the product url paramater.
# i.e. http://example.com/af/big_kite.php would be redirected to
# http://dfhu.org/p.php?id=1&prd=big_kite
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^af/(.*)\.php http://dfhu.org/p.php?id=1&prd=$1 [R,L]
 
# For any file requested in /zaf/ Query String Append that to the
# redirect url i.e.
# http://example.com/zaf/keyboard.php?cat=7&wtf=true would go to
# http://dfhu.org/product.php?affid=77&cat=7&wtf=true
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^zaf/ http://dfhu.org/product.php?affid=77 [QSA,R,L]
 
</IfModule>

Really that is pretty much it. You can now link to the same page one hundred times from your site, using a different URL each time and well behaving search spiders will not know that you are just laboring over just a few landing pages.

An Example

Just to be clear let me show an example using the most common case. Let say our site is http://bignameindie.faux/

bignameindie.faux .htaccess

<IfModule mod_rewrite.c>
 
RewriteEngine On
RewriteBase /
 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^rev/(.*)\.php http://indie.faux/p.php?id=1&prd=$1 [R,L]
 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^dld/(.*)\.mp3 http://indie.faux/?id=1&prd=$1 [R,L]
 
</IfModule>

Then we have to make sure that directories dld and rev are not crawled by the search engines so we update our http://bignameindie.faux/robots.txt as follows.

bignameindie.faux/robots.txt

User-agent: *
Disallow: /dld/
Disallow: /rev/

Then a page on our bignameindie.faux site might look like:

bignameindie.faux/reviews.php

<html>
 <head>
  <title>Big Name Indie Reviews</title>
 </head>
 <body>
   <p>
<q>I'm am bones</q> doesn't have that many great songs,
but i would suggest giving <a 
 href="http://bingnameindie.faux/dld/ostritch_approach.mp3" 
 title="Download The ostrich approach.mp3">The Ostrich Approach
</a> a chance. Really listen to it, its great.
   </p>
   <p>
When were you guys going to tell me about <q>Fujiya + Miyagi</q>?
I can't get enough of <a 
 href="/rev/Knickerbocker.php"
 title="Review of Knickerbocker">Knickerbocker</a>! It is cheesy
but catchy. 
   </p>
   <p>
Ok, now for some really good Indie music without the need for a 
gimmick. Everyone will love <a 
 href="/rev/band-of-horses.php"
 title="Review of Band of Horses">Band of Horses</a>. A great place
to start with them is to listen to <a 
 href="/dld/the-general-specific.php"
 title="Listen to the General Specific">The General Specific</a>.
   </p>
 </body>
</html>

If you are not doing something like this already you are very likely to see improvements in indexing and ranking.

This isn’t going to be the last time I talk about affiliate redirects, because its a fundamental piece of SEO and Marketing which is often overlooked.

The spoiler is that you need to create your own tinyurl style site which is not to be indexed at all, which you then use as a hub to redirect all the affiliate links in your empire through, so you have an insane amount of control in pushing users to the affiliates who are converting best (or the ones that are giving out the coolest prizes/vacations for top sales). As a bonus you can get some pretty snazzy statistics.

There is a bit more too it than that, because in the future you might want to make those links flow juice to some of your other projects, so you can update the redirects on site and take down the robots.txt restriction.

When you start really getting your kingdoms in order, traffic and link juice are just two fluids to be irrigated to parts of your empire with the most favorable growing conditions.

Share
This entry was posted in beginner-programming and tagged , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

2 Comments

  1. Alejandro
    Posted July 29, 2009 at 4:12 pm | Permalink

    Right, so this is what you meant by “changing filenames.”

    Makes a ton of sense now and should destroy footprints. Definitely will implement.

    Since I’m using a wordpress based site,

    I’m using the “Redirection” plugin for redirect as well as “KBRobots.txt” (Robots Meta by Joost van Valk doesn’t let you actually edit the Robots.txt from your WP-admin)

    Thanks for this.

  2. Justin
    Posted October 17, 2009 at 5:00 pm | Permalink

    Nice article, I always knew I should be doing this on my sites but got lazy. I now have about ten affiliate sites that need updating.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

If you are going to post code please use:
<pre lang="php" escaped="true"> YOUR_CODE_HERE </pre>

Change the lang to mysql, python, lisp, whatever. This will escape your code.