HTML redirect, keeping portion of URL intact

I am interested in doing a redirect from our company website (hosted by SquareSpace) to Amazon for product sales.  If we e-mail our customers and want them to look at a suitcase on Amazon, it appears we will not get a commission unless the link comes from our site (am I correct?). My idea would be to redirect from our site automatically. For example:

    OR I could do
            or similar...(B003VB9FCO) is the product ID

Would automatically forward the user to:


tag=xxxxxx-20/ is always the same on their site… Thought I might be able to make a dp.html or dp/index.html page with the right code.

If you have any ideas, I would love to hear them!  Sorry for the newb question, I don't do much site editing.
Eric BIT specialistAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobOwner (Aidellio)Commented:
What you've said is correct.  I suggest you utilize a router like slim ( that can take a url like and parse that into variables for you to use.  From there you can redirect to amazon or other suppliers as needed based on a user friendly URL.  Is that what you're asking?

When I've seen this done in the past it involved framing the site such that your banner is static at the top of the page and the site loads in the frame below.  In your case, amazon

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
David Johnson, CD, MVPOwnerCommented:
AFAIK just the tag is required
Eric BIT specialistAuthor Commented:
AFAIK just the tag is required

We are getting $0 revenue from them, so maybe our email marketing stinks but I recall having to tell them what sites would be the referral source.  I'll email Amazon to see and post back.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Eric BIT specialistAuthor Commented:
Thanks Rob.  Sounds more advanced than I am, was hoping for a basic HTML style easy code since it's just a simple parse / translation.
RobOwner (Aidellio)Commented:
Fair enough :)

The issue here is that to redirect you need to use a server side script like php.  What are you using at the moment? This can't be done with html/JavaScript alone (such that you get the referral)
Eric BIT specialistAuthor Commented:
Good to know, it would be more complex than it's worth it sounds.

I'll just add them to the site and reference them.  Thanks!
RobOwner (Aidellio)Commented:
No problem. What do you mean about adding them to the site? Does that get you the referral somehow?
Eric BIT specialistAuthor Commented:
I had to register my sites with Amazon so I assume they look at the site they come from.  I emailed Amazon to ask if that's the case, will post response here for others to see.
RobOwner (Aidellio)Commented:
Won't that only work if you redirect the user from your website? Or did they give you a code to include in the url for your marketing emails?
Eric BIT specialistAuthor Commented:
Reply from Amazon.  It does need to be referred from one's website, not email newsletter.

I'd hire someone to code this if it works on Squarespace!

While you're welcome to refer your readers to your website in the e-mails you send, we ask that you not include any of your special links in these e-mails. I'm terribly sorry for any inconvenience this may present.

Instead, we do ask that all of your links be posted directly on your website, as this is the only way we can ensure your links are working and tracking activity accurately.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.