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

Add Flash Chat to your Website

We ran into this website recently which allows you to easily insert a flash chat room into your...

301 Redirect

This code will redirect all visitors who attempt to access the old-url.html page to the...

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

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

How do I parse html files as shtml?

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

Creating a Form Button

Sometimes all you need is a simple button. The following pages are pretty useful tools for...