Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Rewrite image for specific referrer


batface - 6:37 am on Nov 5, 2012 (gmt 0)


Ok, I see my mistake, thanks.

This gives me a rewrite to the desired image so the landing page the referrer lands on dishes up the desired background image:

RewriteRule ^images/image\.png$ http://www.example.com/directory/images/new-image.png [L]

I was thinking that the condition is incorrect, so to test created this rule:
RewriteEngine On
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} ^http://(www\.)?thereferrer\.com [NC]
RewriteRule .* - [F]

which works in that I am served a 403 page at the referrer.

So how come the two parts do not work?
RewriteEngine On
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} ^http://(www\.)?thereferrer\.com [NC]
RewriteRule ^images/image\.png$ http://www.example.com/directory/images/new-image.png [L]

confused?!?


Thread source:: http://www.webmasterworld.com/apache/4515652.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com