nginx如何隐藏index.php

nginx隐藏index.php的方法:直接在vhosts.conf配置文件中添加代码“if ( !-e $request_filename) {rewrite ^/(.*)$ /index.php/$1 last;break;}”即可。

nginx如何隐藏index.php

首先打开项目配置文件vhosts.conf;

(推荐教程:nginx使用教程

然后在配置文件中添加如下代码即可。

if ( !-e $request_filename) { 	rewrite ^/(.*)$ /index.php/$1 last; 	break; }

具体配置如图:

nginx如何隐藏index.php

立即学习PHP免费学习笔记(深入)”;

以上就是

© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享