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

在apche conf文件中配置php

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

 

其中xxx指你的ci目录ide

 

而后再在ci目录中添加.htaccess文件,内容以下htm

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

相关文章
相关标签/搜索