2017-04-26 11 views
2

이 기능을 호출하면 로그인 웹 페이지로 리디렉션됩니다. '404 오류 : 요청한 페이지를 찾을 수 없습니다.' 나는 다른 애플리케이션을 위해 따라 갔던 동일한 단계를 밟았으며 정상적으로 작동했다. 어떤 아이디어?Codeigniter를 사용하여 로그 아웃 기능 (Ion Auth)에서 오류 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'); 
} 

BASE_URL

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

답변

0

변경이

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

+0

고마워요! 그것은 'http : //localhost/herba/index.php/auth/login'과 함께 작동하지만 이해가되지 않습니다. 그것은 나의 오래된 proyect로서 'http : // localhost/herba/auth/login'과 함께 작동해야합니다. 왜 이런 일이 일어나는 걸까요? – Jose

+0

'.htaccess' 파일을 확인하십시오. 문제가 있다고 생각합니다. –

+0

어디에 문제가 있습니까? !' 한다 RewriteCond % {REQUEST_FILENAME}에한다 RewriteEngine 한다 RewriteCond $ 1 -d 한다 RewriteCond % {REQUEST_FILENAME}를 -f^(지수 \ .PHP | 자산)! (. *) 한다 RewriteRule^$ ./index.php?$1 [ L]' – Jose

0

확인하시기 바랍니다 당신은 mod_rewrite를 당신의 아파치 설정에서이 프로젝트를 사용할 수 및 allow_override가 있습니까?

+0

xampp을 사용하고 있으며 다음을 수행했습니다. http://www.leonardaustin.com/blog/technical/enable-mod_rewrite-in-xampp/하지만 작동하지 않습니다. – Jose