为什么CodeIgniter出现404错误?

时间:2019-03-30 14:28:19

标签: codeigniter-3

首先,我在所有控制器上都有一个大写字母。

这些作品-http://localhost/country-http://localhost/afghanistan

但是我遇到http://localhost/afghanistan/afcontactus的404错误

我尝试更改文件夹和文件名,例如http://localhost/afghan/afcontact-并成功了。但是,如果我更改原始文件夹和文件名,将无法正常工作。

1 个答案:

答案 0 :(得分:0)

例如,由于Controller函数名称与视图文件名称不同而导致404错误;

public function contactus()
{
$this->load->view('afghanistan/afcontactus');
}

应该是;

public function afcontactus()
{
$this->load->view('afghanistan/afcontactus');
}
相关问题