Jump to content

Facebok reporting Circular Redirect Path after moving to https:


dnt_stp

Recommended Posts

Solved this by creating override on sslRedirection function of FrontController. Here is my code if someone need it:

    protected function sslRedirection()
    {
        // If we call a SSL controller without SSL or a non SSL controller with SSL, we redirect with the right protocol
        if (Configuration::get('PS_SSL_ENABLED') && $_SERVER['REQUEST_METHOD'] != 'POST' && $this->ssl != Tools::usingSecureMode()
            && !preg_match('/.*facebook.*/', $_SERVER['HTTP_USER_AGENT']))
        {
            $this->context->cookie->disallowWriting();
            header('HTTP/1.1 301 Moved Permanently');
            header('Cache-Control: no-cache');
            if ($this->ssl)
                header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
            else
                header('Location: '.Tools::getShopDomain(true).$_SERVER['REQUEST_URI']);
            exit();
        }
    }
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...