Affiliate Marketing

Affiliate Link Cloaking and Redirects: The Safe Way

"Cloak your affiliate links" is some of the oldest advice in affiliate marketing. Early guides recommended it as protection against link hijackers. Some of that advice is still sound, some is…

Some links here are affiliate links — if you buy through them we may earn a commission at no extra cost to you. It never changes what we recommend. Full disclosure.

"Cloak your affiliate links" is some of the oldest advice in affiliate marketing. Early guides recommended it as protection against link hijackers. Some of that advice is still sound, some is obsolete and some is now actively harmful, because the word "cloaking" is used for three very different practices, only one of which is legitimate.

This guide sorts it out. It explains what affiliate link cloaking really means, why publishers use redirects today, how the different redirect methods compare, how search engines treat redirected affiliate links, what affiliate programs allow, how to build a safe redirect system and where the ethical line sits.

Three Things Called "Cloaking"

Also called link masking or link prettifying. You link to a short URL on your own domain, such as yoursite.com/go/product, which forwards the visitor to the affiliate link. The visitor ends up on the merchant's site as expected. This is common, legitimate and generally permitted.

2. Domain masking or framing (avoid)

Your domain stays in the browser's address bar while the merchant's site loads inside a frame. This is widely prohibited by programs, can break tracking and checkout and creates security problems.

3. Search engine cloaking (never)

Showing search engines different content or links from what users see, to manipulate rankings. This is a serious violation of search engine guidelines and can lead to removal from search results.

When affiliates talk about "safe cloaking," they should mean only the first kind.

PracticeWhat happensStatus
Redirect from your domainVisitor clicks yoursite.com/go/x and lands on the merchantLegitimate, generally permitted
FramingMerchant's site loads inside your pageWidely prohibited; breaks checkout
Search engine cloakingSearch engines see different content from usersSerious guideline violation

Why Publishers Use Redirects Today

Older guides justified redirects mainly as a defense against hijackers. Today the stronger reasons are practical:

  • Central management. When a program changes its link format, you switch programs or a product is discontinued, you update one redirect instead of hundreds of links across pages, emails and videos.
  • Tracking. Your redirect can record clicks in your own logs or analytics, independent of program reports.
  • Readable links. A clean link on a domain readers recognize is easier to trust than a long string of tracking parameters.
  • Offline and spoken use. Vanity URLs for podcasts, print, events and video.
  • Email deliverability. Linking to your own domain can avoid inheriting the poor reputation of widely used tracking domains, provided your own domain's reputation is good.
  • Sub-ID management. A redirect can append the right sub-ID automatically based on where the click came from.
  • A modest barrier to casual tampering. Hiding the affiliate ID from casual view discourages some readers from stripping it.

What redirects do not protect against

Redirects do little against modern commission loss: browser extensions that override IDs at checkout, coupon site overrides, cross-device behavior and cookie stuffing all happen after the visitor reaches the merchant. Choose programs with strong tracking and content-partner protection for those risks.

How Redirect Methods Compare

MethodHow it worksAdvantagesDisadvantages
Server-side temporary redirect (often 302 or 307)Your server immediately tells the browser to go to the affiliate linkFast, reliable, invisible, works with trackingNeeds server configuration or a link tool
Server-side permanent redirect (often 301)As above, but may be cached as permanentFastCached redirects can persist after you change the destination
Meta refreshAn HTML page reloads to another URL after a delaySimpleSlower; can look suspicious; can break the back button
JavaScript redirectA script sends the browser onwardCan include logicFails if scripts are blocked; can look suspicious to security tools
FramesMerchant's site loads inside your pageYour domain stays visibleWidely prohibited; breaks checkout and tracking

For affiliate links, a server-side temporary redirect is generally the best choice. It is fast, preserves the visitor's experience, lets you change destinations whenever you need to and does not tell browsers or search engines the destination is permanent.

  • Mark the visible link on your page with rel="sponsored" or rel="nofollow". Pointing to your own domain does not change its nature as an affiliate link.
  • Consider preventing crawling of your redirect folder, such as /go/, with your robots rules, so crawlers do not waste time on redirects. Follow current webmaster guidance.
  • Never show search engines different destinations from those users receive.
  • Keep redirects fast and avoid chains of several hops.

Program Rules on Redirects and Masking

Most programs permit server-side redirects from your own domain, but rules vary. Check for:

  • Prohibitions on framing the merchant's site.
  • Requirements that visitors land visibly on the merchant's site.
  • Referrer requirements. Some programs check the referring page for fraud screening, and some redirect methods remove referrer information.
  • Restrictions in paid search and email, where display URLs or link domains may need to match the merchant's site.
  • Restrictions on public link shorteners associated with spam.
  • Sub-ID formats that redirects must preserve.

When rules are unclear, ask the affiliate manager and keep the answer in writing.

Building a Safe Redirect System

Structure and naming

  • Use a dedicated path, such as /go/ or /recommends/.
  • Use clear, stable slugs: /go/family-tent-4-person rather than /go/12345.
  • Never reuse a slug for a different product.

Tracking

  • Append sub-IDs automatically, in the program's required format.
  • Log clicks with timestamps and source pages, without storing unnecessary personal data.

Maintenance

  • Keep a register of redirects with destinations, programs and dates.
  • Test redirects regularly, including on mobile.
  • Never delete a redirect that might be used in old content, emails, videos or print. Point it to a suitable replacement instead.

Security

  • Never build an open redirect. An open redirect forwards visitors to any destination supplied in a parameter, such as yoursite.com/go?url=anywhere. Attackers abuse open redirects in phishing campaigns, borrowing your domain's credibility to send victims to malicious sites, which can damage your domain's reputation with email providers and search engines. Use only redirects to destinations you have defined, or validate destinations against an allow-list.
  • Protect your link tool's admin interface with strong passwords and multi-factor authentication.
  • Keep the tool and its plugins updated.
  • Use secure connections for the redirect and the destination.

Tip: Keep your redirect register in the same spreadsheet as your program register, with one row per slug showing the program, destination, sub-ID format and last test date. When a program changes its links, you can find and fix every affected redirect in minutes.

Example Redirect Register

SlugProgramDestination typeSub-ID appendedLast testedNotes
/go/tent-4pOutdoor retailerProduct page, 4-person variantYes, by page1 MarchReplacement set if discontinued
/go/micAudio retailerProduct pageYes, by channel1 MarchUsed in podcast; never delete
/go/insurance-quoteInsurance networkQuote formYes1 MarchCheck consent wording quarterly

Vanity URLs for Offline and Spoken Use

Vanity URLs such as yoursite.com/mic are a best practice for podcasts, video, print and events:

  • Memorable and easy to say.
  • Trackable, with a different path per campaign.
  • Updatable without reprinting materials.
  • Trustworthy, because readers see your domain.

Use QR codes pointing at the vanity URL, not directly at the affiliate link, so destinations can change later. Disclose in the medium, and test before printing.

Honest Masking: The Ethical Line

Redirects are acceptable because the visitor still ends up exactly where they expected, and you still disclose that the link earns a commission. They become unacceptable when used to deceive:

  • Hiding the fact that a link is an affiliate link.
  • Sending visitors somewhere other than what the link text promised.
  • Showing search engines, reviewers or program auditors different content from what users see.
  • Disguising prohibited traffic sources from the merchant.

A simple test: if a reader, a merchant and a regulator all saw exactly how your link works, would any of them object? If not, you are on the right side of the line.

Common Mistakes

  • Framing the merchant's site to keep your domain visible.
  • Using permanent redirects that get cached and cannot be changed.
  • Building open redirects.
  • Forgetting to mark redirected links as sponsored.
  • Deleting redirects still used in old videos and emails.
  • Using public shorteners that programs or email filters distrust.
  • Believing redirects protect against modern hijacking.

Frequently Asked Questions

Redirecting through your own domain is generally permitted. Framing the merchant's site and showing search engines different content from users are not.

A server-side temporary redirect is generally the best choice: fast, reliable and easy to change.

Yes. Mark the visible link with rel="sponsored" or nofollow, even though it points to your own domain.

Only casual tampering. Extensions, coupon overrides and cookie stuffing happen after the visitor reaches the merchant.

What is an open redirect?

A redirect that forwards visitors to any destination supplied in a parameter. Attackers abuse them for phishing, so never build one.

Should I block my /go/ folder in robots.txt?

Many affiliates do, to save crawling. Follow current webmaster guidance; it does not replace marking links as sponsored.

For the official rules on cloaking and sneaky redirects, see Google's spam policies.


Redirects should make links easier to manage, never harder to understand. Generate clean redirect rules with the free Htaccess Redirect Generator and check each one with the Redirect Chain Checker.