htaccess referral redirect

It is often useful to redirect a visitor to a page based on the referring website. There are innumerable reasons to do this and can be a wonderful way to create a personal experience for the visitor. 

Edit your .htaccess file and add the following:


RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://(www\.)?partnerwebsite\.com
RewriteRule ^$ /other_directory/specific_page.shtml [L]



  • 146 Users Found This Useful

Was this answer helpful?

Related Articles

Some visitors in China and Russia cannot reach my website

Some networks known for abusive activity such as hacking in countries such as China, North Korea...

What are all these htaccess files?

.htaccess files are used to perform certain rules such as displaying a 404.shtml file in replace...

Why do I get emails for cron jobs?

This is the default. If you would like to disable receiving emails when a cron job runs append...

Disable error_log via htaccess

Prevent public display of PHP errors via htaccess# supress php errorsphp_flag...

Common Search Engine Optimization Tips

Get other websites to link to you. Have your website linked and posted in socal media...