调用此函数将我重定向到登录网页时抛出“404错误:找不到您请求的网页”。我已经遵循了与另一个应用程序相同的步骤,它运行良好。有什么想法吗?
链接

<li>
                            <a href="<?= base_url('auth/logout') ?>">Salir</a>
                        </li>

离子验证功能
// log the user out
public function logout() {
    $this->data['title'] = "Logout";

    // log the user out
    $logout = $this->ion_auth->logout();

    // redirect them to the login page
    $this->session->set_flashdata('message', $this->ion_auth->messages());
    redirect('auth/login', 'refresh');
}

基本URL
$config['base_url'] = 'http://localhost/herba/';

最佳答案

改变这个

public function logout() {
    $this->data['title'] = "Logout";

    // log the user out
    $logout = $this->ion_auth->logout();

    // redirect them to the login page
    $this->session->set_flashdata('message', $this->ion_auth->messages());
    redirect(base_url('auth/login'), 'refresh');
}

请确保
http://localhost/herba/auth/login存在
另请查看index.php
http://localhost/herba/index.php/auth/login

关于php - 使用Codeigniter登出功能(Ion Auth)的错误404,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/43631118/

10-14 00:15