Affiliate Link Cloaker Generator
Turn a long affiliate URL into a clean, self-hosted redirect page you can upload anywhere.
Runs entirely in your browser. Your affiliate URLs are never uploaded or stored.
How to use this tool
This affiliate link cloaker generator builds a small standalone redirect page that you host yourself. There is no backend and no link shortener service in the middle, just one tiny HTML file you upload to your own domain.
- Paste your full affiliate URL, including any tracking parameters, into the first box.
- Choose a clean slug. This becomes the file name and the path people see, for example
best-headphonesturns intoyourdomain.com/best-headphones.html. - Set a redirect delay if you want a brief pause, or leave it at 0 for an instant jump.
- Click Generate redirect code, then copy the code or download the ready made
.htmlfile. - Upload that file to your web host. Share the clean URL anywhere you would normally drop the raw affiliate link.
How the cloaked redirect works
The generated page uses two redirect methods together for reliability. A <meta http-equiv="refresh"> tag handles browsers with JavaScript disabled, and a small inline script using window.location.replace() handles everyone else. Using replace() means the cloaked page does not stay in the browser history, so the back button takes the visitor to where they came from instead of looping. An optional noindex meta tag asks search engines to leave the redirect page out of their results, which keeps your clean URL tidy.
Because the file is plain HTML hosted on your own domain, this is a self-hosted redirect. You are not relying on a third-party shortener that could go down, rate limit you, or get blocked. You own the slug and you own the file.
A real example
Say your raw affiliate link is https://shop.example.com/cart?id=9921&ref=jane2024&tag=spring-sale. That is long, ugly, and obviously an affiliate link. You enter the slug spring-deal and a delay of 0 seconds. The tool produces a file named spring-deal.html. After you upload it, the redirect tracking link becomes https://yourdomain.com/spring-deal.html. A visitor clicks it, the page loads for a fraction of a second, and window.location.replace() sends them straight to the full affiliate URL with all tracking intact.
Common questions
Is this a real link shortener?
It is a self-hosted alternative to a link shortener. Instead of generating a short code on someone else's server, it gives you HTML link shortener code you host on your own domain, so the clean slug and the redirect both belong to you.
Do I need a server or database to cloak an affiliate URL?
No. The output is a single static HTML file. Any plain web host, static site, or file storage that serves HTML will work. There is no backend, no PHP, and no database involved.
Will the tracking parameters still pass through?
Yes. The redirect sends visitors to the exact affiliate URL you entered, query string and all. Whatever ref, tag, or campaign values you include are preserved in full.
Why use both a meta refresh and JavaScript?
The meta refresh covers the rare visitor with JavaScript turned off, while the script provides a faster, history-safe redirect for everyone else. Together they make the redirect tracking link dependable across browsers.
Does cloaking violate affiliate program rules?
Many programs allow self-hosted redirects, but some prohibit cloaking or require disclosure. Always read your affiliate agreement and follow disclosure laws in your region. This tool is provided for educational use and is not legal advice.