[英]Rewrite is not running from matched url
我有以下重写:
rewrite ^([^/]+)/([^/]+)/(.+)$ /index.php?page=$1&action=$2&other=$3&ajax=0;
我以为这以前有用,但没有用。 因此,我要实现的目标是突破这一点,以以下URL为例:
/page1/action1/other1/other2/other3
然后,我希望将值设置为以下php $_GET
变量:
page = page1
action = action1
other = other1/other2/other3
但是由于某种原因,它跳过了重写并转到了另一种方法。 我该怎么做才能使用重写?
我认为nginx在REQUEST_URI中包含前导/
,因此您的模式不匹配。
尝试rewrite ^/([^/]+)/([^/]+)/(.+)$ /index.php?page=$1&action=$2&other=$3&ajax=0;
(为确保没有影响,您可以将其设置为可选: ^/?([^/]+)/([^/]+)/(.+)$
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.