nginx rewrite rule解决思路

WBOY
Release: 2016-06-13 12:09:50
Original
948 people have browsed it

nginx rewrite rule
实现下面的rewrite:
abc.domian.com/sort/2 => abc.domian.com/index.php?act=sort&name=abc&id=2

nginx.conf里面这么写是正确的吧:
rewrite ^/(.+)\/(\d+)\/?$ /index.php?act=$1&id=$2 last;

------解决思路----------------------
基本可以确定你用的CI框架

<br /><br /><br />if (\$request_uri !~ ^/(html<br><font color='#FF8000'>------解决思路----------------------</font><br>static<br><font color='#FF8000'>------解决思路----------------------</font><br>favicon/.ico<br><font color='#FF8000'>------解决思路----------------------</font><br>robots/.txt<br><font color='#FF8000'>------解决思路----------------------</font><br>index/.php.*) ) {<br />                        rewrite ^/(.*)\$ /index.php/\$1 last;<br />                        break;<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