隐藏CI框架路径中的index.php方法

来源:互联网 发布:golang 调用c dll 编辑:程序博客网 时间:2024/06/08 05:56

在CI框架根目录中增加一个htaccess文件,文件内容如下:

<IfModule mod_rewrite.c>
    RewriteEngine on
    Options +FollowSymLinks
    RewriteBase /
     
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1
 
</IfModule>
 
<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>
 
allow from all

=========================

然后在路由配置中,配置好自己的访问方法即可了。

0 0
原创粉丝点击