去掉index.php:
1、修改配置文件, $config['index_page'] = ' '; 设置空

2、修改Apache,搜索 htaccess 将 AllowOverride None 改为 AllowOverride All

搜索 rewrite_module modules/mod_rewrite.so 打开去掉#

3、在CI的根目录下,在system的同级目录下,建立.htaccess文件(创建.htaccess 用Notepad++),写入如下内容:


RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /codeIgniter/index.php/$1 [L]
我的项目地址是 http://localhost/codeIgniter/index.php/user
4、重启Apache直接访问 http://localhost/codeIgniter/user
浙公网安备 33010602011771号