我已经使用CodeIgniter继承了代码库。
首先查看站点时,所有页面都将重定向到主页。之后,该站点将正常运行。
如果我在codeigniter之外创建“真实页面”,则没有重定向。这排除了htaccess问题。
routes.php包含:
defined('BASEPATH') OR exit('No direct script access allowed');
$route['default_controller'] = 'Home';
$route['404_override'] = 'Error_new';
$route['translate_uri_dashes'] = FALSE;
Controller Homes.php
defined('BASEPATH') OR exit('No direct script access allowed');
class Home extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->helper('pagination_helper');
no_cache();
$this->load->helper(array('form'));
$this->load->helper(array('cookie', 'url'));
$this->load->model('home_model');
}
public function index()
{
/*redirect(base_url().'booking');*/
$this->load->library('Mobile_Detect');
$detect = new Mobile_Detect();
if ($detect->isTablet()) {
//$this->home_model->insert_city_in_tbl();
$template['page'] = 'Home/home';
$template['page_title'] = "xxxxx";
$this->load->view('template', $template);
}
else if ($detect->isMobile() || $detect->isAndroidOS()) {
redirect('https://m.xxxx.com/');
} else {
//$this->home_model->insert_city_in_tbl();
$template['page'] = 'Home/home';
$template['logo'] = get_settings_details(1, null);
$template['country'] = get_settings_details(null, 'country');
$template['popular_routes']=$this->home_model->getPopularRoutes();
$template['page_title'] = "XXXXXXX";
$this->load->view('template', $template);
}
}
有人对如何解决这个问题有任何指示吗?
答案 0 :(得分:0)
答案 1 :(得分:0)
解决方案与某些Cookie逻辑有关,将客户重定向到首页。