OK, maybe the title is a bit too provocative. More precisely said, “why using server.error-handler-404 directive for clean URL rewrites in WordPress is a bad solution” would be more appropriate.
Problem:
Switching from Apache to Lighttpd some time ago I used the simplest solution to port my WordPress installation. The quick and dirty way to do it as proposed on numerous occasions (for example chrisjohnston.org or ubuntu-tutorials.com) is OK as an easy fix for most sites – in you virtual host put:
server.error-handler-404 = "/index.php"
This quick trick redirects all traffic to the WordPress core with a single line edit. Brilliant in its simplicity and works fine as a temporary fix. But there’s some nasty side-effect I wasn’t aware of. My wp-recaptcha plugin ceased to show error messages without a reason. Or that’s at least what I thought.
Solution:
I pinned down the problem to the query string being not set when using this kind of Lighttpd setup (see the environment details for more info) – all additional GET variables are lost this way. The information from Daniel’s blog were really helpful here. Now I’m happily using mod_magnet for this without any problems so far. A bit more to setup, but way more flexible. See the tutorial at longspine.com for detailed information.






0 Responses to “Why using server.error-handler-404 is bad?”