尝试将codeigniter 3.0从localhost传输到hostgator上的live服务器时,我得到了404页面。这是我的配置文件中的数据,.htaccess和index.php。
结构:
我的配置文件
$config['base_url'] = 'http://mysyite/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
$config['url_suffix'] = '';
$config['language'] = 'english';
$config['charset'] = 'UTF-8';
$config['enable_hooks'] = FALSE;
$config['subclass_prefix'] = 'MY_';
$config['composer_autoload'] = FALSE;
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use
$config['log_threshold'] = 4;
$config['log_path'] = '';
$config['cache_path'] = '';
$config['rewrite_short_tags'] = FALSE;
的.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
的index.php
$system_path = 'system';
$application_folder = 'application';
答案 0 :(得分:1)
确保所有控制器和模型文件名都以大写字母开头。
从CodeIgniter 3.0开始,所有类文件名(库, 驱动程序,控制器和模型)必须以 Ucfirst-like 命名 方式或换句话说 - 他们必须以大写字母开头。