Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 使用Apache正则表达式到Lighttpd_Regex_Apache_Lighttpd - Fatal编程技术网

Regex 使用Apache正则表达式到Lighttpd

Regex 使用Apache正则表达式到Lighttpd,regex,apache,lighttpd,Regex,Apache,Lighttpd,我只是觉得这件事不对劲 RewriteRule !\.(z|js|ico|css|php)$ index.php [NC] 开发人员(不再在此)将其放入Lighttpd配置中: url.rewrite-once("^(/(?!( \.(z|js|ico|css|php)$)).*)" => "index.php") 但它似乎并没有做同样的事情。请求的任何文件如果没有以这些扩展名之一结尾,则应定向到index.php 我怀疑整个转换是错误的: RewriteRule ^top$ - [N

我只是觉得这件事不对劲

RewriteRule !\.(z|js|ico|css|php)$ index.php [NC]
开发人员(不再在此)将其放入Lighttpd配置中:

url.rewrite-once("^(/(?!( \.(z|js|ico|css|php)$)).*)" => "index.php")
但它似乎并没有做同样的事情。请求的任何文件如果没有以这些扩展名之一结尾,则应定向到index.php

我怀疑整个转换是错误的:

RewriteRule ^top$ - [NC,L]

RewriteRule ^images/.* - [NC,L]

RewriteRule !\.(z|js|ico|css|php)$ index.php [NC]

RewriteRule .*/stats/.* index.php [NC]

有人能帮我吗?这家伙让我左右为难,我几乎没有使用RegEx的经验。

如果我明白你想做什么,就少了一些东西
*
,还有一个额外的
^
(插入符号)

url.rewrite-once("(/(?!(.*.(z|js|ico|css|php)$)).*)" => "index.php")