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]



  • 144 Users Found This Useful

Was this answer helpful?

Related Articles

How to create a temporary 302 redirect via htaccess

An easy way to create a temporary redirect from one page to another web page is to use the 302...

How can I change the default page / document?

Create a .htaccess file, include the below information into it and upload it to the public_html...

How do I remove a web disk?

In Windows, go to My Network Places on your PC, find the connection, right click and delete....

What are all these htaccess files?

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

How do I parse html files as shtml?

Create an .htaccess file in the directory needed and add the following: AddHandler...