【发布时间】:2015-11-12 09:52:39
【问题描述】:
我是 Codeigniter 的新手。我刚刚在谷歌的帮助下在 CI 中创建了一个登录功能,但在这里我在登录时重定向到 URL,但它不起作用。
这是详细信息
重定向链接后是这样的http://localhost/xpensepedia/index.php/home
这给出了 404 错误
404 Page Not Found
The page you requested was not found.
我的控制器是
public function index() {
$this->load->view('header');
if (($this->session->userdata('user_id') != "")) {
redirect(site_url('home'));
} else {
$this->load->view("register");
}
$this->load->view('footer');
}
【问题讨论】:
-
你的 apache 重写模块启用了吗?
-
请出示您的控制器代码
-
如果CI3,
user.php需要是User.php。
标签: php .htaccess codeigniter mod-rewrite