Search code examples
url-rewritinglighttpd

Cannot get url.rewrite and alias.url to play nice together


Current relavent config from lighttpd.conf:

url.rewrite = (
    "^/(.*)\.(.+)$" => "$0",
    "^/(.+)/?$" => "/index.php/$1",
)

and

alias.url += (
  "/xcache/" => "/usr/share/xcache/"
)

I cant get them to work together. From what I understand, the rewrite hijacks the "/xcache/" url thus not triggering the alias.url.

They both work perfectly fine on their own, but cannot get them to work together. Is there a way to exclude certain strings from the url.rewrite expression?


Solution

  • Solved it:

    url.rewrite = (
        "^/(xcache)/(.*)" => "$0",
        "^/(.*)\.(.+)$" => "$0",
        "^/(.+)/?$" => "/index.php/$1",
    )
    alias.url += (
      "/xcache/" => "/usr/share/xcache/"
    )