Regex Lighttpd重写规则(匹配没有句点)
我正在尝试为Regex Lighttpd重写规则(匹配没有句点),regex,mod-rewrite,url-rewriting,lighttpd,Regex,Mod Rewrite,Url Rewriting,Lighttpd,我正在尝试为lighttpd找出一个重写规则,该规则将以以下方式运行: 如果uri(协议和域之后的部分)不包含句点执行规则 示例: uri = "/people/add" Should run the rule. uri = "/js/main.js" Should NOT run the rule. uri = "/people.php" Should NOT run the rule. 到目前为止,我已经做到了这一点,但它的行为并不符合预期,它始终遵循规则: $HTTP["host"]
lighttpd
找出一个重写
规则,该规则将以以下方式运行:
如果uri(协议和域之后的部分)不包含句点
执行规则
示例:
uri = "/people/add"
Should run the rule.
uri = "/js/main.js"
Should NOT run the rule.
uri = "/people.php"
Should NOT run the rule.
到目前为止,我已经做到了这一点,但它的行为并不符合预期,它始终遵循规则:
$HTTP["host"] =~ "^(my\.domain\.com)$" {
url.rewrite-once = (
"^/(.*)$" => "index.php/$1"
)
}
也许你可以试试下面的正则表达式?我不熟悉lighthttpd支持的语法,但如果它支持字符类,下面应该按照您的要求执行
"^/([^.]+)$"