ZBlogPHP::RedirectPermanentDomain PHP Method

RedirectPermanentDomain() public method

检测当前url,如果不符合设置就跳转到固定域名的链接
    public function RedirectPermanentDomain()
    {
        if ($this->option['ZC_PERMANENT_DOMAIN_ENABLE'] == false) {
            return;
        }
        if ($this->option['ZC_PERMANENT_DOMAIN_REDIRECT'] == false) {
            return;
        }
        $host = str_replace(array('https://', 'http://'), array('', ''), GetCurrentHost(ZBP_PATH, $null));
        $host2 = str_replace(array('https://', 'http://'), array('', ''), $this->host);
        if ($host != $host2) {
            $u = GetRequestUri();
            $u = $this->host . substr($u, 1, strlen($u));
            Redirect301($u);
        }
    }
ZBlogPHP