As of lighttpd 1.4.24, mod_magnet is not required to check whether a file exists. ImageCache and clean URL's now work with rewrite rules alone. Using mod_rewrite is less memory intensive and complicated than using mod_magnet with the LUA script linked on the module homepage.

All you need is:

url.rewrite-if-not-file = (
  "^/(.*)$" => "/index.php?q=$1"

Lighttpd documentation for url.rewrite-if-not-file.

This rule goes before your other rewrite rules.

Thought you might want to update the module homepage so people don't think they have to use mod_magnet to use Clean URL's and ImageCache.

#2 imagecache_719508.patch706 bytesdrewish
Members fund testing for the Drupal project. Drupal Association Learn more


veracium’s picture

Here's a brief tutorial about getting ImageCache to work on Lighttpd without mod_magnet.

drewish’s picture

706 bytes

Here's changes for the INSTALL.txt file.

drewish’s picture

Status: Needs review » Fixed

Thanks, committed the patch and updated the project page.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pyc’s picture

That URL is not working anymore...

mcurry’s picture

Assigned: dreamdust » Unassigned
Status: Closed (fixed) » Active

See comment #5.

That URL is not working anymore...

The URL referenced in the INSTALL.txt doesn't work. The referenced content seems to have been removed from

bserem’s picture is not working at all actually, I suggest that the project page gets updated

mcurry’s picture

Ideally, someone could dig up the referenced info that was once on and integrate it into the README.txt, or, if it's more complicated than that, we can create a D.O. doc page... or something.... If the info was useful and not obvious that is.

bserem’s picture

The problem is that the seems to be nowhere now and only the mod_magnet information seems to be available.

Let's see if there are other drupaleros that have lighttpd with imagecache, they might have the info stored! I'll also send a message to Veracium himself and see if he can help.

mcurry’s picture


Thanks for jumping on this. I'm using lighttpd on a few installations, behind a pound reverse proxy, but I cobbled together a working solution that's specific to that configuration and I'm not at all sure it's a good solution -- the only thing going for it is that it works.

I was interested in seeing the solution as an alternative to my approach (and to learn more about lighttpd in this scenario). Unfortunately, I moved on to other things once I had it working.

bserem’s picture

I've sent a mail to veracium this evening (evening in Greece, night in Canada) and I hope that I'll get a reply.

It came as a surprise to me that Imagecache wasn't working and took me about an hour to locate the problem... I've never had a Lighttpd server (and this one isn't mine...!).
You can never get bored of Drupal!

fizk’s picture

Status: Active » Closed (fixed)