在codeIgniter 2.2.0删除的index.php [英] Removing index.php on CodeIgniter 2.2.0
问题描述
我(在Windows 8.1的Oracle VM)上运行的Apache 2.2.22在Ubuntu 12.04.3。 使用PHP函数phpinfo()我看到了mod_rewrite下加载模块的apache2handler部分,因此mod_rewrite的启用。
I am running Apache 2.2.22 on Ubuntu 12.04.3 (Oracle VM on Windows 8.1). Using the PHP phpinfo() function I see mod_rewrite in the apache2handler section under Loaded Modules, so mod_rewrite is enabled.
我做了如下改变我的CI配置文件(application /配置/ config.php文件),
I made the following changes to my CI config file (application/config/config.php),
$config['index_page'] = 'index.php'; to: $config['index_page'] = '';
$config['uri_protocol'] = 'AUTO'; to: $config['uri_protocol'] = 'PATH_INFO';
我已经试过无数版本,这个(位于CI的根目录.htaccess文件):
I have tried numerous versions this(.htaccess file located in the root directory of CI ):
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
但还没有得到它的工作。 还有什么我在这里丢失?
but have yet to get it to work. What else am I missing here?
推荐答案
这个工作!
RewriteEngine On
RewriteBase /testsite/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
这篇关于在codeIgniter 2.2.0删除的index.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!