| Subcribe via RSS


Keep upto date, and get an email whenever new content is posted.


Simply Pop Your Email Address in Here:    


How To Redirect Affiliate Links

December 3rd, 2009 Posted in Web Hosting

Everytime we make a post on our websites we generally have a link to some othersite, usually an affiliate link.

Just this morning, I was updating and old ebook of mine on how people can buy high page rank domains for just $5, and I wanted to redirect them through my affiliate link.

The affiliate link is the usual CJ (commission junction) links, in other words is long and contains lots of numbers and dashes.

So I wanted to put a link that went directly to the other site.

So, lets say we want to make a redirect on this site to Godaddy, using my affiliate link.

So if sometime types in http://www.websitesecrets101.com/godaddy they get sent to godaddy.com with my affiliate code in place.

So , how do we do it.

Its easy to do, all you have to do is open up your websites .htaccess file (please note this approach does not work on Windows servers), with your favourite text editor. Notepad works just fine!

Mine looks like this :

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Its the standard Wordpress .htaccess file.

No I want to make a redirect that goes directly to the affiliate site. Lets say, for this example, I want to redirect them to Goddady. It may not be your most favorite registar but lets just se it for this example.

So using the above .htaccess file, I’ll edit so that it now include the line

Redirect 301 /godaddy http://www.tkqlhce.com/click-3340454-10419685

The 301 part, means that its a permant redirect, you can use 301 or 302 here.

The /godaddy bit  is the path used on this website.

The http://www.tkqlhce.com/click-3340454-10419685 is the affiliate link I will send them to.

So now the full .htaccess file is :

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
Redirect 301 /godaddy http://www.tkqlhce.com/click-3340454-10419685
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

See how I put it just after the “RewriteBase /” line? That means it will redirect without effecting your wordpress install.

So its pretty easy to make redirects by simply modifing your .htaccess file.

4 Responses to “How To Redirect Affiliate Links”

  1. andrew Says:

    Thanks for this blogpost. I was having problems getting my affiliate links to redirect previously. Thanks again. Now everything is working fine.


  2. Bruce Says:

    Glad it help

    Bruce


  3. Arthur Says:

    Hi Bruce,

    Happy New Year & Thanks.
    ;o)

    I was also struggling with that piece of code but now I made 3 tests:

    Redirect 301 /go/GoogleSE http://www.Google.se
    Redirect 301 /GoogleGR http://www.Google.gr
    Redirect 301 /Google-DE http://www.Google.de

    & all of them worked fine!

    I am very happy as in 2010 all my affiliate links will look much professional & contain my IDs.

    Now its time to update all my links on my new WP site…

    Thx again & Happy New Year!
    Arthur.


  4. Expertose Says:

    This is a useful information.

    But I am wondering what I am
    going to do if I am redirecting
    a lot of affiliate links in a
    blog post for instance?

    I will need clarification on this

    ExpertOse


Leave a Reply