放在站点配置文件中
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}
}
本文详细介绍了如何在Nginx中使用URL重写规则,特别是针对不存在的请求路径将请求重定向到index.php,这对于PHP应用的路由管理至关重要。
放在站点配置文件中
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}
}
4538

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