Skip to content

Instantly share code, notes, and snippets.

@jeremyworboys
Created August 14, 2013 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremyworboys/6230206 to your computer and use it in GitHub Desktop.
Save jeremyworboys/6230206 to your computer and use it in GitHub Desktop.
Test Lighthttpd config for Retina Images
HTTP["cookie"] =~ "devicePixelRatio" {
url.rewrite-final += ( "^{url}\.(jpe?g|gif|png|bmp)" => "/retinaimages.php" )
}
@gabrielosz
Copy link

Tried it, no luck... I'm not even sure that it's referencing the retinaimages.php, how would I be able to tell?

Here's my entry in the lighttpd.conf file (I have a few sites running on this server, but only want to test this on one):

$HTTP["host"] =~ "(^|.)website.com$" {
server.document-root = "/var/www/website"
$HTTP["cookie"] =~ "devicePixelRatio" {
url.rewrite-final += ( "^{url}.(jpe?g|gif|png|bmp)" => "/retinaimages.php" )
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment