您的位置:首页 > 技术中心 > PHP教程 >

ci如何去掉index.php(nginx)

时间:2020-08-10 09:41

nginx下ci去掉“index.php”的方法:首先在根目录下新增“.htaccess”文件;然后修改“nginx.conf”配置文件内容为“ rewrite ^/(.*)$ /index.php/$1;”;最后保存修改即可。

推荐:《PHP视频教程》

CI框架去除index.php(Nginx)

在根目录新增.htaccess文件

<IfModule authz_core_module>
    Require all denied
</IfModule>
<IfModule !authz_core_module>
    Deny from all
</IfModule>

修改nginx.conf(如果有vhost.conf文件,则修改此文件)配置文件

location / {
    index  index.html index.htm index.php;
    #autoindex  on;
    if (!-e $request_filename) {
        rewrite ^/(.*)$ /index.php/$1;
    }
}

以上就是ci如何去掉index.php(nginx)的详细内容,更多请关注www.gxlsystem.com其它相关文章!

本类排行

今日推荐

热门手游