Monday, October 10, 2005

Stop Bandwidth Theives – Lighttpd Style

by damonp on October 10, 2005

in Snippets

Previous hotlinking post provided a solution for Apache servers only. Here is one for Lighttpd.

# deny access for all image stealers
$HTTP["referer"] !~ "^($|http://.*\.(domain1\.com|domain2\.com)" {
     url.access-deny = ( ".jpg", ".jpeg", ".png", ".wmv", ".avi", ".mpeg", ".mpg", ".gif" )
}

Replace domain1.com and domain2.com with domains to be allowed as referrers. Modify the list of extension to deny access to.

Popularity: 2%

{ 2 comments }