How to Hide Affiliate Links with 301 Redirects

Whether you are promoting an affiliate offer through your mailing list, on your website or through social media, there are a number of reasons why you may want to a redirect through your own domain rather than the actual affiliate link itself. Many affiliate links can look a little messy and having a shorter, simpler and more memorable URL can really help with branding and conversions.

People are far more likely to click on a link like than what appears to be another domain with a random string of letters.

You can set up what is known as a 301 redirect by editing the .htaccess file in the root directory of your website. This tells search engines that a page has permanently moved to another URL and it simply redirects visitors to your affiliate link’s URL. You can alternatively use an intermediary URL shortener like Bitly for tracking purposes or you can invest in cloaking software for even more robust options and analytics.

The basic process for setting 301 redirects is very simple. Let’s use the hypothetical example of redirecting to


1. Access your website via FTP using a tool like FileZilla. You will need the username and password for your domain.

2. Navigate to the root directory. With many web hosting providers, this is under the public_html folder.

3. Copy the corresponding .htaccess file to your computer.

4. Save a backup copy of the .htaccess file just in case.

5. Open the .htaccess file with a basic text editor.

6. Create a new line with the following code:
Redirect 301 /products/ebook

7. Save the file and re-upload it to your web host using FTP, replacing the old .htaccess file.

With the above example, the assumption is that the .htaccess file is for the domain Additional 301 redirects can then be entered on new lines in the same .htaccess file. And that’s it!

If you are using a content management system like WordPress, there are also a variety of plugins that can further simplify and manage your 301 redirects.

Share on Facebook Share on X Share on LinkedIn Share on Telegram
Related Posts

Leave a comment