Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/68.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
.htaccess nginx重写URL不工作_.htaccess_Nginx_Url Rewriting - Fatal编程技术网

.htaccess nginx重写URL不工作

.htaccess nginx重写URL不工作,.htaccess,nginx,url-rewriting,.htaccess,Nginx,Url Rewriting,我有一些重写.htaccess中的URL,它们在nginx上不再工作了。都是404 .htaccess网址: RewriteRule ^password/reset?$ index.php?a=password&b=reset [L] RewriteRule ^email/verification/(.*)?$ index.php?a=email&b=verification&hash=$1 [L] nginx重写url rewrite ^/password/reset

我有一些重写.htaccess中的URL,它们在nginx上不再工作了。都是404

.htaccess网址:

RewriteRule ^password/reset?$ index.php?a=password&b=reset [L]
RewriteRule ^email/verification/(.*)?$ index.php?a=email&b=verification&hash=$1 [L]
nginx重写url

rewrite ^/password/reset?$ index.php?a=password&b=reset break;
rewrite ^/email/verification/(.*)?$ index.php?a=email&b=verification&hash=$1 break;

尝试使用
/index.php
(带一个前导的
/
)和
最后一个
,而不是
中断
/index.php。为什么我应该使用“last”而不是“break”我真的不知道区别在哪里,这取决于
rewrite
语句的位置,但是如果您的
.php
文件在另一个
位置
块中处理,
last
将导致
nginx
搜索
位置
块,然而,
中断
不会。