标签:配置 nginx nginx配置 com oca nbsp lis filename roo
网站的访问url可能是这样
http://www.xxx.com/index.php/home/index/index
这种有点不美观,我们想达到如下效果
http://www.xxx.com/home/index/index
修改一下nginx配置即可:
server {
listen 80;
server_name www.xxx.com;
root "/var/html/wwwroot/xxx";
index index.html index.php;
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
# ...
}
标签:配置 nginx nginx配置 com oca nbsp lis filename roo
原文地址:https://www.cnblogs.com/zqifa/p/nginx-rewrite-1.html