Even if you connect via http, you can unconditionally connect to https.
It was written based on Apache on Raspbian OS, and if it is the latest version of Apache, you can do the same.
Just insert one line and restart and you’re done.
Very simple.
$ sudo nano /etc/apache2/sites-available/000-default.conf
ServerName domain name
Redirect / https://domain name
Just put it like this.

After making changes, save them in the order of Control+O -> Enter -> Control+X.
Then restart apache and everything will be done.
$ sudo service apache2 restart
If you connect with http as below

Automatically switches to https as shown below.

1 minute is enough