익명 08:20

Apache2 .htaccess rewrite rule to Lighttpd

Apache2 .htaccess rewrite rule to Lighttpd

How can I convert this rewrite rule from apache2 to lighttpd

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]


Top Answer/Comment:

This will send a 403 instead of 404. But I don't know how to send a different http status code than 403.

$HTTP["referer"] =~ "(my\-site\.net)|(www\.my\-site\.net)|(player\.my\-site\.net)|(stream\.my\-site\.net)" {
  url.access-deny = ("")
}

You can find other stuffs:

  • http://www.cyberciti.biz/tips/lighttpd-stop-bandwidth-thief-image-hotlinking.html
  • https://admin-serv.net/blog/392/bloquer-les-vilains-referer-sous-lighttpd/ (in french)
  • http://redmine.lighttpd.net/projects/1/wiki/HowToFightDeepLinking
상단 광고의 [X] 버튼을 누르면 내용이 보입니다