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

What is a Top-Level-Domain (TLD)?

TLD stands for Top Level Domain. This includes any domain names which suffix is .com, .net, .org,...

Can you write a script for me?

We do not write scripts but will be more than happy to guide you in the right direction. Most the...

I can not move out of the / directory, why not?

For security reasons, you cannot move out of the root folder of your own domain.

My index page does not load - Why not?

Filenames are case sensitive. Be sure you have an index filename all in lower case. Examples are...

403 Error on POST

This can occur for several reasons: Be sure your file permissions are correct. If the file needs...