destoon城市分站保持使用主站URL
destoon开启城市分站以后有些链接仍然想使用主站URL链接形式,直接分享干货
文件目录
\www\dt7_7_liuxue\include\city.inc.php
<?php
/*
[DESTOON B2B System] Copyright (c) 2008-2018 www.destoon.com
This is NOT a freeware, use is subject to license.txt
*/
defined('IN_DESTOON') or exit('Access Denied');
$AREA = cache_read('area.php');
$c = array();
$a = array();
$city = get_cookie('city');
$http_host = get_env('host');
if($city) {
list($cityid, $city_domain) = explode('|', $city);
$cityid = intval($cityid);
if(strpos(DT_PATH, $http_host) === false && strpos($city_domain, $http_host) === false) {
$c = $db->get_one("SELECT * FROM {
$DT_PRE}city WHERE domain='http://".$http_host."/'");
if($c) {
set_cookie('city', $c['areaid'].'|'.$c['domain'], DT_TIME + 86400*30</