首页 文章

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

提问于
浏览
0

我在我的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 回答

  • 1

    改变你的路线

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

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

    public function __construct()
        {
                parent::__construct();
    
                $this->load->helper(array('form','url'));
    
        }
    

相关问题