I always wanted to remove those ugly affiliate links from my websites. One of the main reasons why you might want to hide your affiliate link would be, because you do not want to show your customers that you are selling an affiliate product or you do not want to expose your affiliate links, leading to stealing your affiliate commissions. You can either purchase some affiliate redirecting software, to manage all your affiliate redirection or do it free by yourself using htaccess redirection.
Here now, let us see how you can cloak your affiliate link using htaccess redirection
<?PHP
$m = $_GET['m'];
if ($m == "") {$link = "http://blogs.ceeyel.com/shopping/";} // Default Blank
if ($m == "parameter") {$link = "http://www.your_affiliate_link.com/byclick.php?mid=34&id=98";}
if ($m == "parameter1") {$link = "http://shopping.buy.com/click?p=817&a=123456&g=5619";}
/*Keep adding all your affiliate links under a new if statement */
header("Location: $link");
exit();
?>
Save the above file as link.php and upload your file to the main directory. In my case, I have uploaded the above PHP file directly to my public_html folder. Once uploaded you will be able to access your affiliate link, like http://yourwebsite.com/link.php?m=parameter.
Now if you see, the above link is not a clean URL. If you are planning to optimize your website for search engines, it is very much important to make all your URL’s clean so that your page gets indexed by search engines. You can make all your URL’s clean by adding an entry in your .htaccess file. All you have to do is, just add the two lines below to your .htaccess file.
RewriteEngine On
RewriteRule ^shoes_black_ladies\/(.+)$ jump.php?m=$1
Now you will be able to access the same affiliate link using http://yourwebsite.com/shoes_black_ladies/parameter. If you notice the above code you find the keyword “shoes_black_ladies”. We have never created any such folder, but it makes the user believe that all the contents are from that folder thus by hiding all our affiliate links and making our URL clean.
Social Networking