我在Ubuntu 12.04.3上运行Apache 2.2.22(Windows 8.1上的Oracle VM)。 使用PHP phpinfo()函数我在加载模块下的apache2handler部分看到了mod_rewrite,所以启用了mod_rewrite。删除CodeIgniter 2.2.0上的index.php
我做了以下修改我的CI配置文件(application /配置/ config.php文件),
$config['index_page'] = 'index.php'; to: $config['index_page'] = '';
$config['uri_protocol'] = 'AUTO'; to: $config['uri_protocol'] = 'PATH_INFO';
我已经试过无数版本的这个(位于CI的根目录.htaccess文件):
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
但还没有得到它的工作。 我还在这里错过了什么?
所以,我们是否必须在根目录下创建'.htaccess'文件?正如我们知道'.htaccess'文件不存在于codeigniter 2.2的根目录中 – 2015-03-16 02:22:09