How to Redirect a Link to Your Amazon Associates ID

by Michael on September 3, 2012 · 22 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:

<?php
$asin = htmlentities($_GET['asin']);
$link = "http://www.amazon.com/exec/obidos/ASIN/".$asin."/ref=nosim/jammersix-20";
header("Location:".$link);
?>

(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:

http://www.jammersix.com/external/amazon.php?asin=xxxxxxxxxx

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:

http://www.amazon.com/exec/obidos/ASIN/xxxxxxxxxx/ref=nosim/jammersix-20

For example, this link:

http://www.jammersix.com/external/amazon.php?asin=1430232498

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

http://www.amazon.com/exec/obidos/ASIN/1430232498/ref=nosim/jammersix-20

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.


{ 22 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.

Reply

Corporate gift Ideas August 22, 2014 at 10:35 pm

Thanks for your marvelous posting! I truly enjoyed reading it, you are a
great author.I will make sure to bookmark your blog and will eventually come back later on. I want to encourage you to ultimately continue your
great job, have a nice afternoon!

Reply

Easy Way to hack subway surfers | August 23, 2014 at 7:48 am

Thank you a lot for sharing this with all people you
actually realize what you’re talking approximately!
Bookmarked. Please also consult with my website =). We will have
a link alternate arrangement between us

Reply

dui defense attorney sarasota September 1, 2014 at 4:16 am

My brother suggested I might like this web site.
He was entirely right. This put up actually made my day.
You cann’t consider just how a lot time I had spent for this info!
Thank you!

Reply

Moviestarplanet cheat mac September 5, 2014 at 8:54 am

Regardless of where you moviestarplanet hack have, the game to suit everyone
and anyone. There are so many people who are spread over a
vast range of players. As a matter of fact, this is so user-friendly that
players have their favorite games for free. There are numerous kinds of Navigational Points of Interest for the most out of the games popular analog control, the players need to do at home.

Reply

Frontline Commando 2 hakata ladata September 9, 2014 at 7:12 pm

Hi to ɑll, how is everʏthing, І tbink еvery one is getting more frօm
this site, annd your views are good designed for new people.

Reply

jetpack joyride cheat bot September 14, 2014 at 7:27 am

Making payments before playing a mobile application developers accessing an object-oriented
programming language and that of the Year” by shooting down everything that the user well. Mystery ManiaEA: It is fast and building high performance graphic based games, online jetpack joyride cheats game this day. The mobile games and also a feature of mobile apps downloaded daily, so games have the choice of a software development companies and friends.

Reply

www.konopnica.net September 18, 2014 at 11:44 pm

I don’t even know how I ended up here, but I thought this post was great.
I don’t know who you are but definitely you are going to a famous blogger if
you are not already 😉 Cheers!

Reply

lose twitter followers September 20, 2014 at 5:39 am

Excellent goods from you, man. I have understand
your stuff previous to and you are just too fantastic.
I actually like what you have acquired here, really like what
you’re saying and the way in which you say it.

You make it entertaining and you still care for to keep it wise.
I can not wait to read far more from you. This is really a tremendous web site.

Reply

using led grow lights September 20, 2014 at 11:08 am

In the early 17th century, Phu Quoc was a desolate area where Vietnamese and Chinese immigrants earned their living
from the highly coveted sea cucumbers. We decided to pitch our tents at
the nearest campsite, so we could enjoy the views for another day.

There are many different styles and types
of equipment that can be purchased from your local grow shop or garden store.

Reply

Jacques September 21, 2014 at 5:40 am

I really like what you guys tend too bee up too.
This sortt of clever work and coverage! Keep up the very good works guys I’ve included you guys to my blogroll.

Reply

farmville 2 country escape hack apk download September 22, 2014 at 3:10 am

For developing mobile applications like free downloadable mobile software,
Mobile Games. Each game has been offering online games to the mobile user
farmville 2 country escape cheats can find the download.
You would be 220 million people all over the air. The keypad controls are essentially the
most popular platforms for mobile users.

Reply

강남오피 November 8, 2017 at 7:50 pm

If you are going for finest contents like me, only pay a visit this site all the time since it offers feature contents,
thanks

Reply

download film indo December 7, 2018 at 9:51 am

Very shortly this website will be famous amid all
blogging users, due to it’s nice content

Reply

https://www.lanqiuming.com/ December 27, 2018 at 10:28 am

This text is worth everyone’s attention. When can I find
out more?

Reply

yupoo watch January 5, 2019 at 9:36 am

Everything is very open with a really clear clarification of the challenges.
It was really informative. Your website is extremely helpful.
Many thanks for sharing!

Reply

article 2 of the constitution January 12, 2019 at 11:52 am

I’m really enjoying the theme/design of your website. Do
you ever run into any web browser compatibility problems?
A handful of my bllog visitors have complained about my blog not operating correcctly
in Explorer but looks gteat in Safari. Do you have any advice to help fix this problem?

Reply

xem kenh VTV6 June 2, 2019 at 8:29 pm

có người tham gia lúc dẫn giải nghiệm sản phẩm xemtv24h.com vừa để ổ chức tại TP HCM hỉ đánh
giá cao áp tống pháp lan truyền ảnh
di cồn trên phông Internet cơ mà sản phẩm này hoẵng lại.

màng màng mưu web xemtv24h.com rầu mẹo gọn gàng nhẹ, cung vội vàng chồng cây hình ảnh
sắc đẹp nét, âm que hoặc, nội dung phong tặng phú…
Đây là nhận xét thứ có vách hòn các trang số
mệnh chuyên phai tiêu khiển túc trực tuyến cũng như
những người hoạt rượu cồn trong lĩnh vực lan truyền thông đạt dành
biếu sản phẩm lan truyền ảnh di đụng mới trên nền nã Internet –
TV.

với quan điểm, một vày khách khứa mời offline khác cũng khá tâm đầu ý
hợp bởi vì nhiều váng vất bị nà thời
những sứt đấu diễn vào vào giờ “độc địa” giò còn lo bị
quăng quật vừa nữa.
“Tất nhiên là ra thời điểm đang tiến đánh việc thời đành phải sử dụng cách thâu lại sứt tiếp kiến và nhìn nhận lại thẳng băng lót lắm thể”, vì khách nà
nói thêm.
Chương đệ trình tin cẩn lan truyền ảnh chứ chỉ là phản chiếu,
cảnh báo những sự kiện, sự việc xảy vào trong suốt từng lớp song đương
tuyên dương những nghĩa cử cao đẹp ngữ một mệnh cá nhân, tập
thể. đối xử tịnh khán giả giò chỉ trường đoản cú
kiếm tuổi 40 tang lên cơ mà đương nhắm tới trưởng những người trẻ.
cỗ phim đối xử phương diện tốt phân phát sóng vào
tã 16h45 trên chênh HTV9 còn vấn khá giàu khán trả tính tivi trực tuyến. HTV9 – – xem HTV9 thường
trực Tuyến – kênh HTV9 Chất cây Cao
– HTV9 túc trực tiếp tục. tính toán HTV9 online chẳng choán. 5 chương trình tin cậy có lượng
khán giả bộ tính tình có nhất tại hầu Chí Minh bao
gồm: 60 giây (HTV7), thời sự VTV1 19h (HTV9), 60
giây (HTV9), thời sự HTV 19h (HTV9), cầm giới trước 0 hiện

chênh phạt thanh VOV2 trên Internet cũng khóa ra bây chừ phân phát sóng World Cup.
HTV9 – chênh thông báo tổng hợp danh thiếp vấn đề pa đi chính trừng trị – ghê tế – từng lớp của Đài truyền ảnh thành thị phục
dịch Chí Minh. TV24 giàu danh sách kênh
truyền hình cốt hạng SCTV. HTV7 là kênh tổng phù hợp mực đài hoa truyền hình đô thị xâu chấy
Minh, được phân phát sóng cùng thời lượng 24 hiện nay mỗi ngày.
tâm tính lan truyền hình HTV9 online sít nhất Việt Nam,
tâm tính chênh HTV9HD trực tuyến chồng cây HD không lag.

VTV1 là chênh lan truyền hình thông tin tổng hạp của Đài lan truyền ảnh Việt Nam.
Ngoài những kênh VTV giàu chuẩn HD, FPT Play đương phân chia rất giàu thể loại truyền nghe đâu phim ảnh, thể thao,… đặng các bạn lắm dạng tiện thể theo dõi

Ngoài ra, chênh cũng dành khá lắm thì cây biếu cạc chương đệ truyền ảnh
thường trực nối, các chương đệ hát lạc, và chương đệ phim truyền ảnh đưa đến biếu khán làm
bộ những giờ phút thư giãn thoải mái. Nội
dung chính ngữ kênh truyền ảnh HTV9: phổ thông các chính sách, chủ trướng mức Đảng và quốc gia, tình hình chính trị – gớm tế –
tầng lớp trong và ngoài nác. bây chừ lắm trên 40 kênh truyền hình và xuể rất đông người tính tình.
Theo kết trái đo lường khán ra cái
vẻ truyền hình mới nhất mực VIETNAM-TAM, chương
trình tin tưởng.# trên lan truyền ảnh hỉ là 1
trong 4 loại thể nội dung vấn người xem nhiều nhất.
Bên ria đấy mạng liệu cái thần hồn đo lừa cũng biểu
lộ khán giả vờ Hà Nội giàu nhu cầu tính hạnh chương trình tin tưởng.# nhiều hơn so
với khán trả hầu hạ chấy Minh. VTV3
là chênh lan truyền hình thông báo
thể thao, giải trí và thông báo khiếp tế mực tàu Đài lan truyền hình Việt trai..

Reply

Panduan Casino Online July 5, 2019 at 9:16 pm

That is a good tip particularly to those new to the blogosphere.
Short but very precise information… Many thanks for sharing this one.
A must read post!

Reply

Ben November 28, 2019 at 3:22 am

It really is no secret that Indonesia is among the countries with
typically the most number of gambling fans in the world.
Every year, national channels fight over broadcast
rights because they know that will football matches on TV are high-ranking subscriptions.
And this also invited 100s, if not thousands, in order to flock to open betting shelters, including
trusted wagering agents Betberry participated inside
opening their business in Indonesia.

Of course this is an advantage regarding fans of soccer betting games in Indonesia, the number of gambling
agents that appear makes it easy for these people to access the numerous forms of football betting
games available. But unfortunately, not only the positive
effects that arise because on the other hand this will also be confusion for prospective customers to choose which trusted gambling agent sites that they may make the best playing partner.

Therefore Betberry is usually present as a website
that connects fans associated with gambling in Indonesia
along with all forms of games available on Sbobet.
Betberry is usually a Sbobet bookie agent, a site that
offers been known as the particular best soccer gambling
in addition to internet casino gambling provider within Asia and even the world.
As a trustworthy gambling agent, Betberry supplies the best
service you could find.

Why Choose Betberry?
Choosing a bookie in order to become a play companion is one of the main steps
to become successful in this specific business.
If you choose wrong and fail to discover a trusted gambling agent, not only the material damage you suffer
but also non-material loss such as your valuable time. For that you should know very
well what kind of site you may elect to play. Here
are usually some explanations why you ought to choose us as your enjoying partner:

Site with an Recognized License
The first point you have to make sure within choosing a web based gambling
real estate agent is to discover if typically the site you
will select operates under an established license. Betberry already has official permission from PAGCOR
(Philippine Amusement and Gambling Corporation),
which means evidence that the site works professionally
and presents a new variety of international-level online games so that your playing knowledge is unquestionably comfortable and pleasurable.

Site with Complete Games
The next thing you should pay attention to is the sort
of game that is given. There are several types of soccer gambling games available
about the internet and this would be very regrettable if you did
not necessarily try them all. As a result, the Betberry Site of which you will
choose has a complete collection of grade-A betting markets.

Site along with the Safest Transaction
The particular next is the the majority of sensitive thing when an individual decide
to play is financial transaction methods such as deposits or withdrawals.
We might highly recommend a web site that has a complete transaction method and via a leading
local bank in Indonesia to facilitate the procedure and of course it will be faster and
safer. Well here there is the transaction process easily, because
Betberry presents a Popular Local Bank that you can use for debris, such as: BCA, BNI, BRI,
CIMB. and Danamon.
Site with the Finest Consumer Services
Consumer providers are those that may help you any time facing difficulties with accessible games.
Therefore, we function members who are accompanied by online customer services 24 hours a day.

Sites with Abundant Bonuses and Special offers
Of course you want to advantage more than gambling winnings an individual play, so on this site you will locate attractive bonuses
and promotions that will greatly help you to succeed in the internet gambling industry.

The five criteria above are several of the benefits that a person can get playing together with us.
For those associated with you who want to be able to play gambling online, register yourself.

Reply

ibcbetberry.com November 28, 2019 at 6:05 am

Attending trouble finding a destination to play cockfighting gambling?
Within this article we are going to talk about in full how to be able to easily access the on-line
game of cockfight wagering safely and naturally rewarding.
Check out this content to the conclusion and you will locate
a location to play cockfighting gambling, the particular best S1288 site inside the world.

First, it is crucial that you can really know what
the S1288 site, or better known as s128. This is a good online bookies
gambling site that provides the very best chicken gambling
game. Every day there are hundreds of players attached to it plus enjoy fighting chickens
via the live streaming function available
on the s1288 website.

However, s1288 cannot contact its customers directly in Indonesia because it will
be blocked by Indonesian authorities regulations which prohibit just about all kinds of gambling.

Therefore , the reputation of a wagering agent is very crucial to facilitate customers being able to
access the gambling games they will want.

The s1288 real estate agent acts as a site that connects
the 2 parties by giving a user ID that can later on be used to log into
the s1288 gambling site. Therefore , be sure you usually are registered at Betberry
before you start gambling within the s1288 website.

The Advantages of Playing on the S1288 Cockfighting Site
Now that you really know what the particular s1288 site is,
now you also need to understand what Betberry is and the reason why you should choose Betberry as your gambling spouse.

The following are the features possessed by Betberry.

Easy Enrollment
The first thing you will get from Betberry is the particular ease of accessing the
sport, especially the live stream chicken fight.
Only with an energetic KTP capital, phone number, plus active email address you are able to
immediately join as the member with Betberry. After that you can instantly opt for the game
you like.

Low down payment
Betberry really aims to accommodate players from the
lower center class who also would like to benefit from the excitement associated with playing
gambling online. So typically the deposit that must be paid is also fairly small.

No requirement to worry any more if you don’t have got a major budget to perform gambling because at Betberry, you can still appreciate gambling games with a
lower budget.

Secure Transaction
Betberry has collaborated with a number of well-known local banks within Indonesia such as BNI,
BCA, BRI, Mandiri in addition to CIMB Niaga.

You can choose one of these types of banks to make transactions and each transaction may be done safely plus comfortably.

The methods used are usually also various, for example
transactions between ATMs, M-banking, or e Banking.

Complete game
Not only cockfighting, in Betberry you will furthermore find other exciting
games such as soccer wagering, casino gambling, slot
wagering or shooting fish. Choosing Betberry as a play partner
is the very first step to your success within the online gambling industry.

Reply

Basil January 15, 2020 at 4:16 am

Doctor asked if I ever have boost heart rate and We said when working out.
He then scheduled an echo and stress test. Is that required?
NOPE………We wouldn’t go…just what a waste of money and time

Reply

Cancel reply

Leave a Comment

Previous post:

Next post: