这是我的.htaccess文件:
<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 . 它保持不变,页面变白 . 谁能告诉我这是什么问题?
1 回答
只需重定向您的索引或主页控制器