[Solved] Lighttpd Drupal 7 ImageCache | Images are broken | error.handler.404
First of all:
Clean URLs need to be enabled, see snippet below.
ImageCache dynamically generates (resizes) images that don't exist. If you upload an image while creating content, e.g:
http://foo.com/files/styles/thumbnail/1337.jpg
The web-server tries to locate the image:
http://foo.com/index.php?q=files/styles/thumbnail/1337.jpg
If it doesn't exist Apache2 (httpd) passes the request to Drupal (index.php) — benefitting from it's 'drupal friendly' rewrite rules — and the image is generated. The standard 'drupal-ish' rewrite rules for lighttpd just return a 404 error page which breaks the ImageCache workflow.
Lighttpd's rewrite rules do support the file exists flag you just need to enable it!
Here's the solution, 'if-not-file' goes before std. rules:
## ImageCache statement goes before standard rules
url.rewrite-if-not-file = (
"^/(.*)$" => "/index.php?q=$1"
)
## Drupal URL-Rewrite rules without LUA
url.rewrite-final = (
"^/system/test/(.*)$" => "/index.php?q=system/test/$1",
"^/search/node/(.*)$" => "/index.php?q=search/node/$1",
"^/([^.?]*)\?(.*)$" => "/index.php?q=$1&$2",
"^/([^.?]*)$" => "/index.php?q=$1"
)
Hope this helps
| Attachment | Size |
|---|---|
| image-cache.txt | 382 bytes |
- fl0's blog
- 310 reads
Recent blog posts
- Virtual (robot) Flobi - Motion Capture Playback Demo
- LimeSurvey | Default Password Change | Redirect to login page [SOLVED]
- Lighttpd | Can't have more connections than fds/2: 1024
- Warp1337 Theme for you!
- OpenNI Java Wrapper Test | Ubuntu 11.10
- Web history with Screenshots and stuff | Web archive
- [Solved] Lighttpd Drupal 7 ImageCache | Images are broken | error.handler.404
- Ubuntu 11.10 Install freeze at start up | Geforce GTX 570 | It's not your SDD [SOLVED]
- Installed "Oneiric Ocelot" | Ubuntu 11.10 | Looks great | First impressions
- Import CA Certificate in Java Keystore | Input not an X.509 certificate [SOLVED]
What is Flattr ? Flattr is the worlds first social micro-payment system The idea had already been initiated in 2007, but the first release was in 2010 due to typical geeky laziness. Flattr was founded to help people share money, not just content. https://flattr.com/about

















Comments
Post new comment