Lighttpd referer issue
Posted
by
Chris
on Server Fault
See other posts from Server Fault
or by Chris
Published on 2012-11-09T01:16:48Z
Indexed on
2012/11/12
11:05 UTC
Read the original article
Hit count: 239
lighttpd
I have a problem to block files from accessing from different domains as my one.
I have added to my lighty config in the "virual host" following:
$HTTP["referer"] !~ "^($|http://www\.my-site\.net)" {
url.access-deny = ( "" )
}
but anyway the site www.example.com
can access http://player.my-site.net/player.swf
, also it can be accessed directly without a referrer.
any idea?
//EDIT
here is my old apache .htaccess with a rewrite rule thats works perfect, but i dont know how to convert it for lighty:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_REFERER} !^http://my-site\.net/ [NC]
RewriteCond %{HTTP_REFERER} !^http://www\.my-site\.net/ [NC]
RewriteCond %{HTTP_REFERER} !^http://player\.my-site\.net/ [NC]
RewriteCond %{HTTP_REFERER} !^http://stream\.my-site\.net/ [NC]
RewriteRule .* - [L,R=404]
© Server Fault or respective owner