Link Code Generator Logo
Link Code Generator

Free Affiliate Link Cloaker & Redirect Generator

Hide ugly affiliate URLs with clean, trustworthy links. Generates HTML, PHP, and .htaccess redirect code for any platform.

How you want the link to look.

Help & Guides

What Is Link Cloaking?

Link cloaking is the practice of replacing a long, ugly affiliate tracking URL with a clean, branded URL on your own domain. Instead of sharing tracker.net/aff_c?offer_id=123&affiliate_id=456, you direct visitors to yoursite.com/recommends/product — which then invisibly redirects them to the offer.

This has three key benefits: clean links build more trust with readers, they are easier to remember and type, and they can be updated centrally if the destination URL ever changes — without having to update every blog post and social media post where you shared the link.

Three Ways to Cloak a Link

This tool generates three different technical implementations based on your hosting environment:

  • HTML Meta Refresh: Save as an index.html file. Works on any web host, no PHP required. The browser immediately follows the meta refresh tag to the destination. Best for simple static sites and subdirectory approaches.
  • .htaccess Rewrite Rules: A server-side redirect rule for Apache-based hosting (most WordPress sites, cPanel hosts). The redirect happens at the server level before any HTML is sent, making it fast and SEO-friendly.
  • PHP Header Redirect: A header("Location: ...") call that executes a 301 or 302 redirect at the PHP level. Fastest execution, and the status code can be controlled for SEO purposes.

Best Practices for Cloaked Links

  • Use a /recommends/ directory: The convention yoursite.com/recommends/productname is widely understood by readers and signals transparency about the affiliate relationship.
  • Always disclose affiliates: FTC guidelines require disclosure of affiliate relationships regardless of how the link is formatted. Cloaking a link does not exempt you from this requirement.
  • Do not cloak links to Amazon: Amazon's Associates Operating Agreement explicitly prohibits cloaking links to Amazon. For Amazon, use our Amazon Affiliate Link Builder to generate direct, compliant associate links instead.
  • Use 301 for permanent links: If you are promoting a product you expect to feature long-term, use a 301 redirect so search engines pass link equity appropriately.

Frequently Asked Questions

Is link cloaking the same as a URL shortener?

Functionally similar, but not the same. A URL shortener hosts the redirect on a third-party domain (bit.ly, is.gd, etc.). Link cloaking puts the redirect on your own domain, which looks more professional, builds brand trust, and gives you full control over the destination — useful if the affiliate URL changes later.

Which method should I use — HTML, .htaccess, or PHP?

Use .htaccess if your site runs on Apache (WordPress, cPanel hosts). Use PHP if you prefer scripted control or need conditional redirects. Use HTML Meta Refresh if you have a static site or want the simplest implementation without server configuration.

Will this hurt my SEO?

No, if done correctly. Use 301 redirects for permanent affiliate pages. This passes link equity from the cloaked URL to the destination, same as any other standard redirect. Search engines understand and follow 301 redirects cleanly.

Get smarter about link tracking

UTM strategies, campaign tricks, and new tools for marketers who want cleaner data.

All Tools Directory

Every free tool, in one place. Perfect for anyone who needs to create QR codes, build UTM-tagged links, generate contact links, or manage campaign URLs. No account required.

Amazon Affiliate Link Builder

Clean up messy Amazon URLs and generate perfect Associate links using your affiliate tag.

Link Expirator & Countdown Snippet

Generate a Javascript snippet to automatically expire a link and redirect traffic after a specific date and time.

Link Cloaker & Redirect

Generate HTML, PHP, and .htaccess redirect codes to hide ugly affiliate links.

Link Rotator

Generate a JavaScript snippet to randomly rotate traffic across multiple destination URLs based on percentage weights.

A/B Split Tester

Generate a Javascript snippet to split landing page traffic between two URLs for A/B testing.

URL Shortener

Instantly shorten long URLs to display clean links on social media.

UTM Link Builder

Easily add UTM parameters to URLs so you can track Custom Campaigns in Google Analytics.

SMS Link Generator

Create clickable sms: links that open the native text message app with a phone number and pre-filled message. Generates the URL and HTML code.

Mailto Link

Create advanced email links with pre-filled subjects, CC, BCC, and body text. Generates standard URLs and HTML code.

Direct Review Link

Generate direct 5-star review links for Google My Business, Yelp, Facebook, and Trustpilot to send to your customers.

Social Share Link

Create 1-click sharing links for Twitter, Facebook, LinkedIn, Reddit, and more. Generate custom URLs and HTML buttons.

Telegram Link

Create direct Telegram links using a username or phone number. Generates t.me URLs and HTML code.

WhatsApp Link

Create click-to-chat WhatsApp links with pre-filled messages. Generates wa.me URLs and HTML code.

Barcode (1D)

Generate, preview, and download 1D barcodes (Code128, EAN-13, UPC, etc.) instantly in your browser.

GA4 Cross-Domain Tracker

Generate Google Analytics 4 (GA4) cross-domain tracking code snippets to maintain user sessions across multiple websites.

Smart App Deep Link

Generate smart routing scripts that detect the user OS and redirect to native mobile apps falling back to web URLs.

HTML Link

Generate clean, perfectly formatted HTML anchor tags with custom rel, target, class, and ID attributes.

Open Graph Meta Tag

Generate the perfect Open Graph and Twitter Card HTML meta tags for social media link sharing optimization.

Payment URL

Generate unified deep links to accept payments via PayPal, Venmo, and Cash App.

QR Code Generator

Create custom QR codes with colors, logos, and multiple export formats.

WiFi QR Code

Create a WiFi QR code for your home or business. Guests scan to connect instantly — no password typing needed.

vCard QR Code

Create a vCard QR code for your business cards. Seamlessly share contact info straight to their phone book.

Social Media QR Code

Generate a QR code linked to your Instagram, Twitter, or TikTok.

Payment QR Code

Generate a payment QR code for Venmo, PayPal, or Stripe.

Event QR Code

Generate an iCalendar Event QR code for your invitations.

Location QR Code

Generate a QR code for a physical location mapping.

Email QR Code

Generate a mailto QR code.

Phone Call QR Code

Generate a phone call QR code.

SMS QR Code

Generate an SMS text message QR code.

App Store QR Code

Generate a QR code to link to your app on the App Store or Google Play.

Universal Location & Maps Link

Generate universal smart routing scripts and direct deep links for Google Maps, Apple Maps, and Waze.