Force Website to https


#1

I installed lets encrypt and its working fine:


But it is still possible to access usefulvid.com without https.
I choose the “easy” option and now I like to configure it manually to force visitors to https.
I changed the standard wordpress url to https -> no effect
I read this guide:
https://www.ssl.com/how-to/force-https-connections-in-an-apache-server-environment/
And changed the htaccess file but after that the page was a total mess.
RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.usefulvid.com/$1 [R=301,L]

edit:
also without the rewite mod, subpages are not accesible via https:


#2

You could try with virtual hosts. I followed this guide for my synology nas.


My virtual host file is a little simpler, because I already added the certificate to the DSM.

NameVirtualHost *:80

<VirtualHost *:80>
	ServerName mystorage.dk
	Redirect permanent / https://mystorage.dk/
</VirtualHost>

<VirtualHost *:80>
	ServerName www.mystorage.dk
	Redirect permanent / https://www.mystorage.dk/
</VirtualHost>

NameVirtualHost *:443

<VirtualHost *:443>
	ServerName mystorage.dk
	DocumentRoot /volume1/web/test/
	SSLEngine On
	# etc...
</VirtualHost>

<VirtualHost *:443>
	ServerName www.mystorage.dk
	DocumentRoot /volume1/web/test/
	SSLEngine On
	# etc...
</VirtualHost>