nginxrewrite重定向有关问题
时间:2021-07-01 10:21:17
帮助过:26人阅读
nginx rewrite 重定向问题?
https://www.123.com/770422332/index.php => http://www.123.com/index.php?id=770422332
我想怎么变化该怎么写rewrite
location / {
rewrite ^/(/d+)\/index\.php$ /index.php?id=$1 last;
}
我怎么写不行~不知道错在哪里~帮忙看下谢谢~!
------解决思路----------------------https://www.123.com/770422332/index.php
你这个是啥规则啊?
https://www.123.com/index/770422332
=>
rewrite ^/index\/(/d+)$ /index.php?id=$1 last;
------解决思路----------------------
rewrite "^/(/d+)/index.php$" /index.php?id=$1 last;