Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/24.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 .htaccess重写正则表达式问题_Regex_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

Regex .htaccess重写正则表达式问题

Regex .htaccess重写正则表达式问题,regex,apache,.htaccess,mod-rewrite,Regex,Apache,.htaccess,Mod Rewrite,我曾尝试在web上使用各种regex测试程序对此进行调试,但它们似乎都表明语法是正确的,更不用说,当我在web.config文件中使用该表达式时,它起到了作用 但是,我目前正在将我的web应用程序移到一个新的Linux服务器上,显然,当启用此特定重写时,我的.htaccess返回一个500内部服务器错误: # Set the General Page Rewrite RewriteRule ^([^(?!_)\/]+)\/?([^(?!_)\/]+)?\/?([^\/]+)?\/?$ $1.ph

我曾尝试在web上使用各种regex测试程序对此进行调试,但它们似乎都表明语法是正确的,更不用说,当我在
web.config
文件中使用该表达式时,它起到了作用

但是,我目前正在将我的web应用程序移到一个新的Linux服务器上,显然,当启用此特定重写时,我的
.htaccess
返回一个
500内部服务器错误

# Set the General Page Rewrite
RewriteRule ^([^(?!_)\/]+)\/?([^(?!_)\/]+)?\/?([^\/]+)?\/?$ $1.php?request=$2&id=$3& [NC,QSA,L]
有人能看到正则表达式失败的地方吗

使现代化 这是我的日志中的错误:

由于可能的配置错误,请求超出了10个内部重定向的限制。如有必要,使用“LimitInternalRecursion”增加限制。使用“日志级别调试”获取回溯跟踪


在第二个(目的地)部分前面加上
/
(就在
$1
之前)@andreduna我不太明白。。。你的意思是把
/$1.php…
???如果是这样,恐怕这绝对不是问题所在:-(是的。这可能是原因。啊,还有,在规则之前,你是否打开了
重写引擎?是否启用了
mod_rewrite
?@andreduna恐怕没有。出于礼貌,我测试了它,但我知道这不会是问题,不幸的是,我在同一
.htaccess
中还有大约10次重写,他们都没有。。。