Clean Affiliate Links with SEO Friendly Redirects

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://samirbalwani.com/");
exit();

301 Redirect in Java

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

Get the SiteFox Newsletter for Free!

Comments

  1. seomoves says:

    Thanks for the code, was looking around for it, have bookmarked your website.

Speak Your Mind

*