添加重写规则
Nginx
location / {
index index.html index.htm index.php;
#autoindex on;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1;
}
}
本文介绍了一种Nginx中的重写规则配置方法,通过设置location块内的指令实现对请求路径的重定向,确保当请求指定资源不存在时能够将请求导向到index.php进行处理。
添加重写规则
location / {
index index.html index.htm index.php;
#autoindex on;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1;
}
}
783
513

被折叠的 条评论
为什么被折叠?