PDA

View Full Version : htaccess redirect clicks help


OLM
08-25-2009, 12:00 PM
Hi all,

I wonder if someone could possibly please help with this question.

Is it possible to block clicks coming from a site to my site and then redirect the person to another page using a htaccess file??

Example:

If I have a number of clicks coming from (example) banana123.com I would want those people to be redirected to a notallowed.html page

I would also want it to catch people where banana123 is in any part of the url so news.banana123.com, banana123.co.uk, search.banana123.com etc - basically if banana123 is included in any part of the url.

If anyone could help it would really be appreciated and probably save me a lot of grief :confused:

Many thanks

Steve

abduraooft
08-25-2009, 12:17 PM
Try RewriteEngine On
RewriteCond %{HTTP_REFERER} banana123 [NC]
RewriteRule .* http://yoursite.com/notallowed.html [L]

OLM
08-25-2009, 02:44 PM
Hi,

Many, many thanks for the reply - it was very much appreciated!!!

That looks like it has worked - and the added benefit is that not only is
it redirecting clicks it is also preventing images being pulled from the site which
is also really helpful.

A++++

Many thanks!!

cheers

Steve