[英]base url is not working ? 404 error codeigniter
i have this config on my codeigniter file : 我在我的codeigniter文件上有此配置:
$config['base_url'] = 'http://kandanghosting.com/mtma/';
and i set my folder like this in my server 我在服务器中这样设置文件夹
but still get this error 但仍然出现此错误
404 Page Not Found
404页面不存在
The page you requested was not found. 未找到您所请求的页面。
my htaccess : 我的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>
my routes : 我的路线:
$route['default_controller'] = 'home';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
my completed config : 我完成的配置:
$config['base_url'] = 'http://kandanghosting.com/mtma/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
$config['url_suffix'] = '';
改变你的路线
$route['default_controller'] = 'Home';
add this code part to your controller 将此代码部分添加到您的控制器
public function __construct()
{
parent::__construct();
$this->load->helper(array('form','url'));
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.