rewrite

lighttpd redirect to external url if file not found

Below is a rewrite/redirect rule using url.rewrite-[repeat]-if-not-file similar to Apaches' "!-f" RewriteRule.

# Redirect to external url if image file not found
url.rewrite-if-not-file = ( "^\/images\/.*\.jpg$"; => "/redirect$0" )
url.redirect = ( "^\/redirect\/(.*)$" => "http://other.domain.tld/$1" )

Comment