我在服务器上部署了一个Codeigniter应用程序,我无法弄清楚是什么导致了:
The page you requested was not found.
我的.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
我的config.php
$config['base_url'] = 'http://188.166.54.225/';
$config['index_page'] = '';
mod_rewrite是enbled。
我无法理解原因,可能是因为控制器的名称是这样的:
Login_controller.php
调试Codeigniter.php:
if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php'))
{
var_dump(empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php'));//TRUE
var_dump(empty($class));// FALSE
var_dump(! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php'));//TRUE
$e404 = TRUE;
}
我的路线:
$route['test'] = 'TestController';
$route['register'] = 'auth/RegisterController/register';
$route['login'] = 'auth/LoginController/login';
$route['logout'] = 'auth/LoginController/logout';
$route['contact'] = 'ContactController/index';
$route['contact/(:num)'] = 'ContactController/index/$1';
$route['create'] = 'ContactController/create';
$route['edit/(:num)'] = 'ContactController/update/$1';
$route['delete/(:num)'] = 'ContactController/delete/$1';
$route['reset_search'] = 'ContactController/reset_search';
$route['default_controller'] = 'ContactController/index';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
APPPATH.'controllers /'.$ RTR->目录的var转储。$ class。'。php:
/var/www/phonebook/application/controllers/Auth.php
所以它试图获取Auth.php,但Auth是一个文件夹而不是文件