Guest Article: Hiding ugly affiliate links using redirects

Prompted from a discussion in the forums about working with bad URL’s from certain affiliate programs we have a guest article from Harvey Kane a local SEO Consultant;

Hiding ugly Affiliate links using redirects

At some point in your affiliate career, you will invariably come across affiliate links that look a little bit too much like affiliate links. And while there’s a percentage of the population who will click on almost anything, some people won’t be so inclined to click an affiliate link.

There are a number of methods out there for working around this problem, but by far the most common method is to use an intermediary redirect script. I wanted to talk about how to do this properly, and also provide some example code for PHP.

Getting started
First, we need an affiliate link that we will be redirecting to. Let’s use a real affiliate link as an example, this way you are able to click all the example links and see them in action. This link is for Webdrive, whom I host my website with - http://www.webdrive.co.nz/?REF=HAR612 (yep, looks pretty much like an affiliate link).

Instead of linking to Webdrive directly, we want link to an intermediary page with a less affiliate-looking URL. Such as http://www.ragepank.com/webdrive/ (if you click the link it will redirect you to Webdrive).
It is up to you to choose a format for your intermediary redirect page, and make sure it is configured to redirect correctly. I’ll discuss a few ways of doing this below.

Subdomains
You will sometimes see affiliates using subdomains for their affiliate links - eg http://webdrive.ragepank.com - these look a little more official, and if you are lucky, your web host will let you setup the redirect via their control panel (no code required). If you can setup subdomain redirects via your web host, I would recommend using this method.

Easy Redirect Screenshot

If your web host allows, this is the easiest way to setup a redirect.

Domains
Funnily enough, I was digging around one afternoon and noticed that web-drive.co.nz was available (note the dash). I grabbed it, and setup a redirect sending all traffic to my affiliate link. I figured a few affiliate signups would easily cover the domain registration costs. I’m not a lawyer, but I don’t believe this is cybersquatting - and you could argue that I’m doing them a favour (I’m trying to drive more traffic to their site right?). However, you can understand if merchants don’t see the funny side of this approach. I was contacted by Webdrive’s managing director a few weeks later, and because I’m a mature adult, I handed the domain over without any fuss.
Needless to say, I wouldn’t entirely recommend this approach.

Regular redirects
The normal way of doing a redirect is to setup a script on your own hosting account. You have full control over the how you want the URLs to look, but in my experience it’s best to keep them simple and obvious. If you only have a handful of redirects, it’s easy enough to edit them manually, otherwise you can store the redirects in a database to make management simpler (which is what I do).

Redirect using PHP
If your web hosting supports PHP, then this is the most reliable way of doing redirects, and won’t give you too much grief getting them setup. However, the resulting URLs aren’t quire as nice looking as they can be.

Create a new file in the root of your website with the following code…

<?php
/* array of all affiliate links you need */
$redirects = array(
‘webdrive’ => ‘http://www.webdrive.co.nz/?REF=HAR612′,
‘example’ => ‘http://www.example.com?aff_id=1235′,
);
/* if the specified ID is in our list, do the redirect */
foreach ($redirects as $id => $destination) {
if (isset($_GET[$id])) redirect($destination);
}

/* general-purpose redirect function */
function redirect($url, $type=301) {
if ($type == 301) header(”HTTP/1.1 301 Moved Permanently”);
header(”Location: $url”);
echo ‘This page has moved to <a href=”‘.$url.’”>’.$url.’</a>’;
exit();
}

/* if there is no match, issue a ‘not found’ header */
header(”HTTP/1.0 404 Not Found”);
echo ‘This page could not be found’;
exit;

Edit the $redirects array (adding extra lines if you need to) to reflect all the redirects that you need.
Then, link to www.ragepank.com/r.php?webdrive (replace ragepank.com with your own domain).

This redirect should now work - minimum fuss, and unlikely to run into any compatibility issues on most web hosting providers.

.htaccess method
The above method is great because it’s simple and reliable. But if you are looking for a URL that looks more like http://www.ragepank.com/webdrive/ (which I consider easier on the eye) you will want to look at the .htaccess method instead. This will only work for Apache based websites, and the Apache extension mod_rewrite needs to be enabled - ask your web host if in doubt. There are similar methods for IIS and other web servers, though I’m not going into the details in this article.

First, get the above PHP method working. The .htaccess method builds on this code.

Then, look in the root of your website for a file named .htaccess - if this doesn’t exist, create it. Otherwise, open it up for editing.

Add the following code into .htaccess

RewriteEngine On
RewriteRule ^(webdrive)/?$ r.php?$1

Note that “RewriteEngine On” may already be in your .htaccess file - if this is the case, no need to add it a second time.

To add additional redirects, copy the line containing “webdrive” and replace with the URL you want to use. If you want your link to be http://www.example.com/fishpond/ then the code would be:
RewriteRule ^(fishpond)/?$ r.php?$1

Simply use a new line for each redirect you need to setup. It’s worth noting that the .htaccess method will slow down your website if you have too many redirects in the list. If you find yourself needing more than about 50 redirects, it’s probably time to look for a different solution. If you only need a few redirects, then you won’t notice any difference in performance.

It’s possible you will get a “500 Internal Server Error” at this stage. Generally, this means your web host doesn’t allow this code to be run in .htaccess, so at this stage I would contact their support team and ask for assistance.

The poor man’s method
If the .htaccess method gives you trouble, and you only need a couple of redirects setup, you can always do it the old-fashioned way.

Create a new folder within your website, called “webdrive” (or whatever you want the link to be). Inside the folder, create an index.php file, and place the following code inside:

<?php
header(”HTTP/1.1 301 Moved Permanently”);
header(”Location: http://www.webdrive.co.nz/?REF=HAR612″);
exit;

Simply change the Affiliate link to whatever you need it to be, and that’s all the configuration needed. You will need to repeat this process for each redirect you want to create. It’s not the most technically elegant solution, but it works, and it’s easy.

All of the redirect methods mentioned here are good ways of masking the affiliate links, and these techniques are commonly used by many affiliates.

Harvey Kane is an SEO consultant, who blogs at www.ragepank.com

Thanks to Harvey for the guest article, it gives a good summary of options that most affiliates will take some time to get through while they’re building up their repotoire of code.

Labels:

Designing a website for affiliate marketing

If you’re an affiliate and have a bright idea for what you’d like to build an affiliate website about (and potentially a domain you like) you’re ahead of the curve already.

Next you’re going to ask yourself, what should my website look like?

If you’re a designer by trade, you’re going to spend hours pondering the correct design for the audience that you’re looking to target and you’re probably going to go through a half-dozen iterations of a website design in Photoshop or Illustrator. There’s even the chance you’ll get most of the way through a design, scrap it and start again. I know I’ve done this a couple of times before and it’s probably a good display of the lack of planning I put into what I was trying to achieve in the first place.

Many affiliate marketers aren’t designers but they would prefer to have a website that looks good. This is where templates come into their own as paying for a designer to build you an affiliate site is reasonably rarely a cost effective solution (particularly when you’re trying to build a site’s traffic organically). We’re going to ignore Ferrit in this discussion although I’m pretty sure it’s no-where near cost effective to date :).

So, you have an idea a domain and need a design.

There are so many template design options out there now it’s a wonder that any real design work gets done at all. I would have to say that a large number of newly created affiliate marketing website I’ve seen this year are created through template designs.

Template designs offer just the right level of cost effectiveness e.g. they’re free and are generally well tested, particularly if you’re working with a large scale Open Source blogging or CMS platform like WordPress, Joomla! or the like.

Here are a few template directories: WordPress Themes, Joomla Templates, Drupal Themes, Xoops Themes

All it takes is a couple of quick adjustments on a logo file and the website you’re trying to get off the ground can look (to the untrained eye) like you’ve spent the last month in development and have some pretty hot design skills.

So, if you’re looking at designing a website specifically for affiliate marketing, perhaps you can start with a template, build up the traffic to the site (which is what’s really going to gain you the revenue) and then if all is going well, look to expand or re-design once you have proof of your concept.

Labels: