Magento 2 Unable to redirect http to https when using multistore

All we need is an easy explanation of the problem, so here it is.

I am unable to redirect HTTP to https when using a multistore option. Anyone else using more than one store and has the http->https auto redirection working from .htaccess?

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

Try to do this via database:
-> Go to core_config_data table
-> in base_secure or unsecure url change http to https
Secondly, check if your server has SSL Certification.

Hope it works!

Method 2

There were multiple issues. For once port 80 was only accessible from a specific address I changed that in the firewall. Also the configuration mentioned is not redirecting for me even though I set Use Secure URLs on Storefront to Yes. The way I solved the issue is that I set the https url for base urls and base urls ( secure )

Method 3

Magento has default functionality for set secure(https) and unsecure(http) url.

Before update bellow setting backup core_config_data table.

Go to Store-> Configuration-> General-> Web->Baseurl(secures) and
update http to https.

Update the value of Use Secure URLs on Storefront to Yes.

Refresh cache php bin/magento cache:clean.

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply