找不到Codeigniter的主页

找不到Codeigniter的主页,codeigniter,Codeigniter,我的linux服务器中的CI项目有问题(windows wamp中没有问题), 在我的项目中,除了显示404错误的主页(没有任何查询字符串的地址)之外,每个路由都可以正常工作。 以下是我的配置: htaccess: DirectoryIndex index.php RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(

我的linux服务器中的CI项目有问题(windows wamp中没有问题), 在我的项目中,除了显示404错误的主页(没有任何查询字符串的地址)之外,每个路由都可以正常工作。 以下是我的配置: htaccess:

DirectoryIndex index.php
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA] 
Options -Indexes
php_flag output_buffering On
my routes.php:

$route['default_controller'] = 'index';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
$route['index'] = 'index/index';
$route['/'] = 'index/index'; // i have controller index.php and action index for first page that load with address example.com/index/index
my config.php:

$config['base_url'] = 'http://example.com';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO'; //and  "REQUEST_URI" both tested.
请提供任何帮助。

这个“它在Windows上工作,但在Linux上不工作”的问题几乎总是由于文件命名错误造成的。您的“默认控制器”类似乎命名为“索引”。文件名和类声明都必须使用大写的第一个字符

换句话说,文件必须是Index.php(注意大写的I),并且声明必须是

class Index extends CI_Controller
同样,请注意索引中的大写字母“I”

所有这些都清楚地表明,控制器不应被命名为索引因此,选择其他名称