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 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 create a helpdesk ticket?

You may create a helpdesk ticket at any time by visiting https://my.ultrawebhosting.com and...

View your website in older browser versions

As developers and webmasters it is always important to make sure your website works in several...

How can I change the index listing in a directory?

You can change the initial page that is sent to client requests when a directory is accessed by...

What are these htaccess files that keep popping up?

.htaccess files are default files the server uses to perform certain tasks. Features such as...