2016-06-16 27 views
0

在這裏工作是我的.htaccess文件:重定向()函數不是笨2.0

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase /abc_dev/ 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ index.php?/$1 [L] 
</IfModule> 

這是我的config.php:

$server_protocol  = 'http://'; 
$application_name  = ''; 
$website_fullpath  = $server_protocol.$website_path; 
$application_path  = str_replace(basename($_SERVER['PHP_SELF']),'',$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']); 
$application_fullpath = $server_protocol.$application_path; 
$config['base_url'] = $application_fullpath; 
$config['log_threshold'] = 0; 

這是我的構造函數:

function __construct() 
{ 
    parent::__construct(); 
    $this->load->model('Modelhome');   
    $this->load->library('nsession'); 
    $this->controller = 'home'; 
    $this->load->helper('url'); 
    $this->load->helper('string'); 
} 

這是我的退出功能:

function logout(){ 
    $this->nsession->destroy(); 
    redirect(base_url()); 
} 

如果註銷重定向(base_url())在服務器中不起作用。 網址變成http://example.com/abc_dev/home/logout。它保持不變,頁面變白。誰能告訴我有什麼問題?

+0

什麼是nsession你確定它應該是會議 – user4419336

+0

啓用錯誤報告,看看是否有任何錯誤是發生 – Vinie

回答

0

只是給你的索引或主頁控制器重定向

redirect('c_home',refresh); 
+0

不,不工作。 它轉到http://example.com/abc_dev/home/logout/,白頁 –

+0

$ config ['base_url'] ='';設置此 – Gopalakrishnan

+0

不,不工作.. –