【发布时间】:2016-02-21 09:02:57
【问题描述】:
当我将 codeigniter 上传到服务器时,我遇到了 404。我尝试了所有已知的方法,但仍然无法找到解决方案 我的.htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteCond $1 !^(index\.php|images|js|uploads|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
config.php
$config['base_url'] = 'http://example.com';
$config['index_page'] = '';
$config['uri_protocol'] = 'QUERY_STRING';
routes.php
$route['default_controller'] = 'lloyd';
控制器 lloyd.php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Lloyd extends CI_Controller{
public function __construct() {
parent::__construct();
}
public function index()
{
$theme = $this->aauth->get_system_var("theme");
$this->load->view($theme . '/home');
}
}
【问题讨论】:
-
$config['uri_protocol'] = 'REQUEST_URI';没用
-
这可能是你的文件名,如我的回答所示,
标签: codeigniter routes http-status-code-404 codeigniter-2