nginx rewrite 重定向有关问题

WBOY
Release: 2016-06-13 12:08:12
Original
899 people have browsed it

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;
------解决思路----------------------

<br /><br />rewrite "^/(/d+)/index.php$" /index.php?id=$1 last;<br /><br />
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template