How to Redirect a Link to Your Amazon Associates ID

by Michael on September 3, 2012 · 30 comments

If you have an Amazon Associates account, you might be wondering about the best way of managing your links. Sure, you could create a different link for every product, but that quickly gets unwieldy. Surely there’s a better way. Right?

Wouldn’t it be nice to feed the product ID into a standard link and let your web server craft the link for you?

What I’m talking about here, of course, is creating a redirect for your Amazon (or other) affiliate links. If you’re using WordPress to run your site, you could use a plugin to manage your affiliate redirects. But, as I’ve noted before, I don’t like using plugins for things that can be easily achieved with a bit of custom code.

What happens if the plugin’s creator loses interest and stops updating? It happens. And if it happens to you, you’ll be stuck with a huge cleanup project on your hands. Not worth it when you can roll your own solution in less time than it takes to find and install a plugin. Plus, the method outlined here works for just about any backend, not just WordPress.

The simplest solution (in my book) is to create a PHP redirect. To do this, create a .php file (i.e., just a text file containing a bit of PHP code) with the following:

$asin = htmlentities($_GET['asin']);
$link = "".$asin."/ref=nosim/jammersix-20";

(sorry about the awkward line wraps)

Be sure to replace “jammersix-20” with your own affiliate ID — or don’t, if you’re feeling generous. ;-)

I named this file amazon.php and stashed it in /external at the root level of the domain. Thus, to use it, I simply link to:

If you replace xxxxxxxxxx with the actual Amazon product ID number (ASIN = Amazon Standard Identification Number) the redirect will produce a well-formed Amazon link with your Associates ID that points to the product of interest.

The end product will look like this:

For example, this link:

results in an Amazon link that points to a handy book about PHP solutions for dynamic web design. The end product looks like this:

Go ahead, click both versions. They work exactly as advertised.

Wondering how I found the ASIN? The easiest way is to just look at the page url after you’ve navigated to the product of interest. You’ll see it embedded in the Amazon url right after /dp/.

The beauty of this approach is that: (1) you’re not dependent on a third-party developer, and (2) if you ever change your affiliate ID in the future (or if Amazon changes the acceptable link structure) you only have to update it in one place.

{ 30 comments… read them below or add one }

Erica September 6, 2012 at 2:01 pm

Thanks for the tips. I use a redirection plugin which allows me to create a link using my own url. This way if they change the structure I just go in the back office and change the link that it directs to.


clash of clans cheats gem hack December 7, 2013 at 6:57 pm

This is my first time visit at here and i am in fact impressed to read all at alone place.


world of tanks hack download December 13, 2013 at 11:46 pm

It’s great that you are getting ideas from this post as well as from our dialogue made here.


need for speed world cheats December 14, 2013 at 9:06 am

Linnk exchanye is nothing else however it is only placing the
other person’s weblog link on your page at suitable place
and other person will also do same in support of you.


Auguri Di natale December 17, 2013 at 5:53 pm

I’d like to thank you for the efforts you’ve put in penning
this website. I’m hoping to check out the same high-grade content from you later on as well.
In fact, your creative writing abilities has motivated me to get my very own website now ;)


shopping website design December 18, 2013 at 5:20 pm

I quite like reading an article that will make men and women think.

Also, thanks for allowing for me to comment!


watch movies December 20, 2013 at 4:16 pm

It is possible to attach your computer in
your existing television or even an LCD projector.
The same situation applies with the online movie sites, using hosting
disclaimers; users are advised to neither upload nor
download illegal content, yet, there’s really not even attempt to stop you from doing so.
naturally one is destined to be better than the other.


Nidia December 20, 2013 at 10:58 pm

Wow, wonderful weblog layout! How long have you been running a blog
for? you make running a blog glance easy. The entire glance of your website is wonderful, as neatly as the content


新着 パンプス 注目 December 21, 2013 at 12:55 am

Greetings from Idaho! I’m bored to death at work so I decided to browse your website on my iphone during lunch break.
I really like the info you present here and can’t wait to take a look when I get home.
I’m amazed at how quick your blog loaded on my cell phone ..
I’m not even using WIFI, just 3G .. Anyhow, awesome site!

Reply December 25, 2013 at 6:01 am

When you happen to be searching for current events or political
blogs, many topics and situations of debate will likely
be located online in addition to in publications today. The topic was trips to market, and I was explaining
in regards to the articles I had written associated with conserving money on groceries and just how to feed all your family
members on the budget. On satellite TV, it is possible to find
out what are the Hindi, Spanish, or French news stations have to
convey about current events in America.


pantyhose fetish chat December 31, 2013 at 6:45 am

Having read this I thought it was extremely enlightening.
I appreciate you taking the time and energy to put this information together.
I once again find myself spending way too much time both reading and leaving
comments. But so what, it was still worthwhile!


Kayla January 10, 2014 at 7:32 pm

Hello! I know this is kind of off topic but I was wondering which blog platform are you using for this site?
I’m getting fed up of Wordpress because I’ve had problems with
hackers and I’m looking at options for another platform.

I would be fantastic if you could point me in the direction of a good


fotograf ślubny olkusz January 14, 2014 at 10:14 am

Good way of explaining, and good article to get facts regarding my presentation subject matter, which
i am going to present in college.


webpage January 18, 2014 at 4:41 am

It is really a great and useful piece of info.
I am glad that you simply shared this useful information with us.
Please stay us informed like this. Thanks for sharing.


Fifa 14 coins hacking January 23, 2014 at 7:37 am

excellent put up, very informative. I wonder why the other experts of this sector don’t understand
this. You must continue your writing. I’m confident, you have a huge
readers’ base already!


Noreen January 30, 2014 at 9:17 am

We absolutely love your blog and find most of your post’s to be just what I’m looking for.
Do you offer guest writers to write content for you?

I wouldn’t mind producing a post or elaborating on a lot of the subjects
you write about here. Again, awesome weblog!


Mamie February 6, 2014 at 5:51 pm

Its like you read my mind! You seem to know
so much about this, like you wrote the book in it or something.
I think that you could do with some pics to drive
the message home a bit, but instead of that, this is excellent
blog. An excellent read. I’ll definitely be back.


splinter cell pobierz February 7, 2014 at 1:34 pm

Good web site you’ve got here.. It’s hard to fknd high quality
writing loke yours these days. I honestly appreciate individuals like you!

Takke care!!


Nuva lift anti aging complex February 12, 2014 at 6:26 pm

Good day! I simply want to give you a big thumbs up for your excellent
info you’ve got here on this post.I will be returning too
your website for more soon.


the pirate bay news october 2009 February 14, 2014 at 7:31 am

This would be a good sign, as we hadn’t likely to find greatly fine gold in the
stone. Scores of reefs are now lying idle in
Queensland from which tremendous yields were obtained close to the
surface, but which were abandoned for want of capital.
Much maudlin sentimentally, and far empty declaration, have been written and talked
about crime, and from the punishment of criminals with death.

Reply February 16, 2014 at 11:39 pm

You’re ten yards away from her, the beast is 15 ,maybe
20. It’s easy too understand why people get anxiou feelings at parties.
Your anxiety disorder is actually a diagnosable aand treatable disorder, an illness as
real as diabetes.


torrent February 20, 2014 at 2:23 pm

Hello! I could have sworn I’ve been to this blog before but after reading through some
of the post I realized it’s new to me. Nonetheless, I’m definitely delighted I found
it and I’ll be book-marking and checking back often!


Youtube.Com March 4, 2014 at 2:41 am

Hello There. I found your blog using msn. This is an extremely well written article.
I’ll make sure to bookmark it and return to read more of your useful information.
Thanks for the post. I will definitely return.


the simpsons blog March 6, 2014 at 1:28 am

The series was originally produced by Seth Mac – Farlane and was first aired in January 1999.
The show generally is about Homer Simpson and his family. So precisely what sorts of
situations are there to determine and do when your Orlando vacation takes
you to Universal Studios.


best seo company March 6, 2014 at 3:27 pm

Can I just say what a comfort to uncover somebody who really understands what they are discussing
on the net. You certainly know how to bring an issue to light and make it important.

A lot more people really need to look at this and
understand this side of the story. I was surprised
that you aren’t more popular given that you certainly possess the gift.


massage envy ahwatukee March 10, 2014 at 9:49 pm

We are a group of volunteers and opening a new scheme
in our community. Your web site offered us with valuable info to work on.
You have done an impressive job and our whole community will be thankful to you.


make money March 13, 2014 at 12:35 am

Employees approach the work with a more positive attitude. You can work
according to your pace and adaptability. Visit my website as I will show you a step by step
guide on how you can make money online by setting uup your
first work froom home website.


the pirate bay news november 2012 April 6, 2014 at 1:28 am

In July, 1887, a credit card applicatoin was heard inside
the Clermont Warden’s Court for any reef claim 200 yards
west of Hurley’s Dam, and also the ‘Telegram’ states:.
His fee was 110 guineas, which in the hotelkeeper was 30 guineas.
Just since your swelling goes down somewhat responding on the diuretic doesn’t imply you are getting better.


mobile games April 15, 2014 at 8:48 am

Woah! I’m really loving the template/theme of this website.
It’s simple, yet effective. A lot of times it’s very difficult to
get that “perfect balance” between superb usability and appearance.
I must say you have done a awesome job with this.
Also, the blog loads very fast for me on Opera.

Excellent Blog!


day trading April 23, 2014 at 9:51 pm

Heya i’m for the first time here. I came across this
board and I find It truly helpful & it helped me out a lot.
I hope to provide something again and aid others such as you helped me.


Leave a Comment

Previous post:

Next post: