nginx如何隐藏index.php

nginx如何隐藏index.php,第1张

nginx如何隐藏index.php

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

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

(推荐教程:nginx使用教程)

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

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

具体配置如图:

以上就是nginx如何隐藏index.php的详细内容,

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/707828.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-24
下一篇 2022-04-24

发表评论

登录后才能评论

评论列表(0条)

保存