Just add : function redirect($url) { global $db, $board_config; if (!empty($db)) { $db->sql_close(); } $server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://'; $server_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name'])); $server_port = ($board_config...