基本网址不起作用? 404错误codeigniter

时间:2016-11-01 08:57:16

标签: php codeigniter

我在我的codeigniter文件上有这个配置:

$config['base_url'] = 'http://kandanghosting.com/mtma/';

我在我的服务器中设置了这样的文件夹 enter image description here

但仍然会收到此错误

  

未找到404页面

找不到您请求的页面。

我的htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

我的路线:

$route['default_controller'] = 'home';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

我完成的配置:

$config['base_url'] = 'http://kandanghosting.com/mtma/';

$config['index_page'] = '';

$config['uri_protocol'] = 'REQUEST_URI';


$config['url_suffix'] = '';

2 个答案:

答案 0 :(得分:1)

更改路线

$route['default_controller'] = 'Home';

答案 1 :(得分:0)

将此代码部分添加到您的控制器

public function __construct()
    {
            parent::__construct();

            $this->load->helper(array('form','url'));

    }
相关问题