ci中的url重写,去掉index.php

在apche conf文件中配置

<Directory "/var/www/html/xxx">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

 

其中xxx指你的ci目录

 

然后再在ci目录中添加.htaccess文件,内容如下

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

posted @ 2015-03-20 11:46  扎克  阅读(973)  评论(0编辑  收藏  举报