nginx实现url重写
2018-11-28 本文已影响0人
IARNO
![](https://img.haomeiwen.com/i9550427/be80b936afb7d99e.png)
nginx配置
- rewrite实现
location / {
root /home/wwwroot/test;
index index.php index.html;
if ( ! -e $request_filename ) {
rewrite (.*)$ /index.php/$1;
}
}
- try_files实现
location / {
root /home/wwwroot/test
index index.php index.html
try_files $uri /index.php?$uri;
}