在codeIgniter 2.2.0删除的index.phpcodeIgniter、php、index

2023-09-02 01:01:47 作者:最黑的夜才能看见最亮的星

我(在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]