Clean Affiliate Links with SEO Friendly Redirects

by Samir Balwani on August 14, 2008

One of the best things an affiliate can do to increase their conversion rate is by redirecting their affiliate links. This means instead of showing a long nasty affiliate link, you show a link to a page you host that redirects to your affiliate link. People generally don’t trust long links with numbers in them.

But if you’re going to create a redirect you want to make sure it’s search engine friendly, especially if the target page is one of your sites. Mostly, this means making sure it’s a 301 redirect (permanent). I’ve put together how to make the redirect in PHP and Java.

It’s important to remember that if you’re using Wordpress, you can just install the Redirection Plugin. It will not only redirect urls that don’t exist, but it also tracks clicks, and logs 404 errors.

Search Engine Friend Redirects

Based on which redirect you use, be sure to wrap it in PHP or Java tags. Also, this must go at the very beginning of the page, make sure there are no spaces before this code.

301 Redirect in PHP

header("HTTP/1.1 301 Moved Permanently");
header("Location: http://leftthebox.com/");
exit();

301 Redirect in Java

response.setStatus(301);
response.setHeader( "Location", "http://www.dexterityunlimited.com/" );
response.setHeader( "Connection", "close" );


Recommended Reading:

{ 0 comments… add one now }

Leave a Comment

You can 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>