找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索本站精品资源

首页 教程频道 查看内容

nginx如何配置index.php 隐藏

作者:模板之家 2020-11-1 18:49 117人关注

nginx配置index.php隐藏的方法:首先找到并打开“nginx.conf”配置文件;然后添加代码为“location / {if (!-e $request_filename) {...}}”并保存即可。

nginx配置index.php隐藏的方法:首先找到并打开“nginx.conf”配置文件;然后添加代码为“location / {if (!-e $request_filename) {...}}”并保存即可。

推荐:《PHP视频教程》

ThinkPHP5.0的nginx配置隐藏入口文件index.php

只需要在配置文件nginx.conf添加下面这串代码

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

如下图红色框框部分

86208661b5ee3c529512a30d110b20c.png

PS:宝塔linux面板的nginx隐藏入口文件,需要在网站--当前站点的设置--配置文件下 增加上面那串代码(亲测有效)

以上就是nginx如何配置index.php 隐藏的详细内容,更多请关注模板之家(www.mb5.com.cn)其它相关文章!


路过

雷人

握手

鲜花

鸡蛋
来自: 网络收集

全部回复(0)