Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
What have you tried? –  j0k Nov 13 '12 at 9:17
    
@j0k: i have tryed to forbid access to my files from foreign domains. –  Chris Nov 13 '12 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 '12 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 '12 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:

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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