apache去掉index.php
1.编辑conf/httpd.conf配置文件
#LoadModule rewrite_module modules/mod_rewrite.so 把该行前的#去掉
同时对应Directory下要配置 AllowOverride All
2.在 CI 根目录下(即在index.php,system的同级目录下)新建立一个配置文件,命名为: .htaccess 内容如下:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteRule ^(.*)$ index.php/$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(application|modules|plugins|system|themes) index.php/$1 [L]
3.把system/application/config/config.php 中$config[‘index_page‘] = "index.php";改为$config[‘index_page‘] = "";
4.重启apache
php CI 实战教程:如何去掉index.php目录,布布扣,bubuko.com
原文:http://www.cnblogs.com/wang3680/p/e561833183aa6e0a278b4c1f4b334fd1.html