nginx rewrite 重定向有关问题
程序员文章站
2024-01-17 21:14:10
...
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;
------解决思路----------------------
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;
相关文章
相关视频