0

I am trying to figure out a rewrite rule for lighttpd that will behave in the following way:

If the uri (the part after the protocol and domain) does not contain a period execute the rule.

Examples:

uri = "/people/add"
Should run the rule.

uri = "/js/main.js"
Should NOT run the rule.

uri = "/people.php"
Should NOT run the rule.

Here is what I have so far, but it does not behave as expected, it always runs the rule:

$HTTP["host"] =~ "^(my\.domain\.com)$" {
    url.rewrite-once = (
            "^/(.*)$" => "index.php/$1"
    )
}
Justin
  • 42,716
  • 77
  • 201
  • 296

1 Answers1

1

Maybe try the following for your regex? I'm not familiar with the syntax lighthttpd supports, but if it supports character classes, below should do what you are asking.

 "^/([^.]+)$"
Lone Shepherd
  • 965
  • 1
  • 7
  • 25