CI 3.0 隐藏index.php

来源:互联网 发布:安卓6.0优化教程 编辑:程序博客网 时间:2024/05/18 00:01

修改apache httpd.conf文件

这行去掉注释#LoadModule rewrite_module modules/mod_rewrite.so第一步:修改<Directory />    AllowOverride none    Require all denied</Directory>为<Directory />    AllowOverride all    Require all denied</Directory>

第二步:

CI根目录添加.htaccess文件RewriteEngine onRewriteCond $1 !^(index\.php|style|robots\.txt)RewriteRule ^(.*)$ /i1894/index.php/$1 [L]当然如果你的目录不是根目录,则要注意,比如我的URLhttp://localhost/ci,则最后一行要改为RewriteRule ^(.*)$ /ci/index.php/$1 [L]

最后一步:
修改config.php文件

$config['index_page'] = "index.php"; 修改为 $config['index_page'] = ""

重启apache服务器,大功告成。

0 0
原创粉丝点击