Issues

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

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:

http://example.com/?style=my.css
http://example.com/index/?a=1&which=nice.gif

would match the first rule and fail. Perhaps these are edge cases, however.

You are absolutely right Darby

I may have a solution, you just have to swap two lines:


url.rewrite-once = (
  ".*\?(.*)$" => "/index.php?$1",
  ".*\.(js|ico|gif|jpg|png|css)$" => "$0",
  "" => "/index.php"
)

Please categorize/fix as needed.

Fixed with SVN r9420.

Changing to comply with new IT coventions for components.