0

i'm using this htaccess rule on a apache:

RewriteEngine on
RewriteCond %{HTTP_REFERER} example\.com [NC]
RewriteRule .* - [F]

.. and i would convert it to an lighttpd rewrite rule. How can i do this? I tried it but it does not work very well.

hazelnut
  • 25
  • 1
  • 7

1 Answers1

0

Seems to be answered here: Apache2 .htaccess rewrite rule to Lighttpd

So something like:

$HTTP["referer"] == "example.com" {
    url.access-deny = ("")
}

If you need to match the sub-domains too:

$HTTP["referer"] =~ "^(.+\.|)example\.com$" {
    url.access-deny = ("")
}
Yvan
  • 350
  • 3
  • 8