博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

CI 框架去掉url 中index.php的方法

Posted on 2015-04-29 09:43  myzerg  阅读(419)  评论(0编辑  收藏  举报

1 修改 apache 的 httpd.conf 文件 

#LoadModule rewrite_module modules/mod_rewrite.so   

去掉前面的# 

2 找到 你程序目录下的 .htaccess 文件

内容如下

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

 

保存 ,重启就好了