2

I've thought it is done by modifying .htaccess file, but it is not. Making changes to the "force https" option doesn't change the .htaccess file. Can someone explain to me what is the mechanism behind Joomla's "force https" setting in the Global Configuration?

4

It is handled within the SiteRouter class in Joomla, more specifically in its parse() method where the following condition changes the scheme part of the URI if force_ssl property of the application is set that way and then redirect it:

if ($this->app->get('force_ssl') == 2 && strtolower($uri->getScheme()) !== 'https')
    {
        // Forward to https
        $uri->setScheme('https');
        $this->app->redirect((string) $uri, 301);
    }

More info on SiteRouter class is here: https://api.joomla.org/cms-3/classes/Joomla.CMS.Router.SiteRouter.html

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.