ZF-2901: Lighttpd rewrite rule
Description
In the Programmer's Reference Guide (Section 7.5.1.), about the lighttpd rewrite rule there is:
url.rewrite-once = (
".*\.(js|ico|gif|jpg|png|css)$" => "$0",
"" => "/index.php"
)
But with this rewrite rule you miss the HTTP GET parameters
I suggest this rule (tested with succes on my website):
url.rewrite-once = (
".*\.(js|ico|gif|jpg|png|css)$" => "$0",
".*\?(.*)$" => "/index.php?$1",
"" => "/index.php"
)
Regards
Jean-Yves
Comments
Posted by Darby Felton (darby) on 2008-03-20T15:32:20.000+0000
It looks like both rulesets would be susceptible to breaking when GET parameters end in the same suffixes as listed in the first rule of each ruleset. For example, URLs such as:
would match the first rule and fail. Perhaps these are edge cases, however.
Posted by Jean-Yves Pellé (djiwhy) on 2008-03-20T17:47:56.000+0000
You are absolutely right Darby
I may have a solution, you just have to swap two lines:
Posted by Wil Sinclair (wil) on 2008-03-25T21:09:52.000+0000
Please categorize/fix as needed.
Posted by Darby Felton (darby) on 2008-05-08T10:22:52.000+0000
Fixed with SVN r9420.
Posted by Wil Sinclair (wil) on 2008-06-15T20:40:17.000+0000
Changing to comply with new IT coventions for components.