could you help me to 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]

Thank you

  • @j0k: i have tryed to forbid access to my files from foreign domains.
    – Chris
    Nov 13, 2012 at 10:03
  • I mean, did you try something before coming here and ask for help, which is not really help but more a could you do that for me because I'm too lazy to search on Google ...
    – j0k
    Nov 13, 2012 at 10:37
  • yes of course, tryed add it by my self and google. nixcraft has a good article to lighttpd and hotlinking prevention, also here are some good posts. But everything i'm trying, it is not working.
    – Chris
    Nov 13, 2012 at 12:26

1 Answer 1


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:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.