Apache Server configuration support - rewriting all referrers not from my site

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > November 2006 > rewriting all referrers not from my site





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author rewriting all referrers not from my site
Arjen

2006-11-04, 7:19 am

Hi !
Is it possible (and how) to rewite all request for pictures that do no
originate from my site to pass through a filter.

example
www.mysite.com/pic/pic23.jpg should be
www.mysite.com/referrer.php?pic=pic23.jpg

In pic.php I check if they have visited my site ( I set a cookie) and if
not .. watermark the picture.

I found something on the web that works a little but it doesn't rewrite
specifically enough .. any ideas ?


RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yoursite\.com [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} ^http://.*$
RewriteRule \.(jpe?g|gif|bmp|png)$ /media/nohotlinks.png [L]
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com