SE-Friendly Redirection and URL Mask
March 23rd, 2007 by Matt HugginsIf you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
I put together a basic search engine friendly script that performs URL masking and redirection. It’s nothing fancy, but it might help some of you who are into affiliate marketing. I plan to update it at some point with a basic setup page and simple click-through stat tracking, but this is a good start for those of you who don’t have anything like this set up.
Once you have the contents unzipped, you’ll want to modify the mappings to suit your needs. To do this, edit the settings.inc.php file. Initially, you will see several mappings similar to the following:
$redirects = array(
'day-job-killer' => 'http://AFFILIATE.dayjobkill.hop.clickbank.net/?tid=$1',
'ultimate-wealth-package' => 'http://AFFILIATE.imarichkid.hop.clickbank.net/?tid=$1',
'rich-jerk' => 'http://AFFILIATE.richjerk.hop.clickbank.net/?tid=$1',
);
Simply modify the list by placing the desired mask on the left, and the destination URL on the right. Basic use would occur through a URL such as:
http://domain.com/r/rich-jerk
which would forward you to:
http://AFFILIATE.dayjobkill.hop.clickbank.net/?tid=
Regular expressions can be used for special cases, such as tracking codes used in ClickBank. In the sample above, you could pass a tracking code of “email” by accessing a URL like the following:
http://domain.com/r/rich-jerk/email
which would forward you to:
http://AFFILIATE.dayjobkill.hop.clickbank.net/?tid=email
Download SE-Friendly Redirector, and let me know what you think in the comments here.
Related Posts:
- Projects
- Continued Blog Growth
- 18 Common Mistakes by Google AdSense Publishers that Violate Terms
- Free Contextual Website Marketing
- Website Grader

Subscribe by E-mail
March 23rd, 2007 at 9:28 pm
Interesting post. Since Blakeize.com didn’t sell on Ebay this week I set-up a 502 redirect at the server level to point the domain to an affiliate product.
There was an option for masking, but I don’t know if I trust a mask when it comes to recording a sale.
I’m going to re-list Blakeize.com when Blake makes it to the final 3.
Michael
August 12th, 2007 at 6:28 pm
I came here from ShoeMoney’s post, and I guess people were too busy arguing to even say a simple thank you. I’m not using this script yet, but I wanted to thank you for your efforts anyway!
August 12th, 2007 at 8:00 pm
My pleasure coolio, thanks for stopping by!
August 23rd, 2008 at 10:40 am
Thanks for this tutorial. I had been wondering how to do that until i read this.