【发布时间】:2016-10-12 10:32:15
【问题描述】:
我知道这个问题已经被问过很多次了,但我真的无法解决这个问题。 我的默认控制器正在工作,但如果我想访问另一个控制器,我将遇到 404 问题。
我的控制器文件名大写为 Utilisateur.php,
所以我试图通过<a href="Utilisateur/inscription">inscription</a>访问控制器功能inscription
这是我的配置:
$config['base_url'] = 'http://localhost:63342/WeBusy/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
这是我的根:
$route['default_controller'] = 'accueil';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
最后是控制器:
class Utilisateur extends CI_Controller {
public function inscription(){
$data = array('header' => 'HeaderAccueil.php', 'body' => 'utilisateur/AjoutUtilForm.php');
$this->load->view('StructureHtml.php', $data);
}
谢谢
【问题讨论】:
-
在你的函数 inscription() - 删除所有内容并放入 echo 'test';
-
那么你就可以真正看到它是路线还是别的什么了。
-
完成了,我仍然有 404 错误
-
http://localhost:63342/WeBusy/index.php/utilisateur/inscription有效吗?
标签: php codeigniter http-status-code-404