only ssl access (443) not on port 80

Hi.

I want to access my website only via https://demo.example.com and not http://demo.example.com How can I disable in virtualmin the access on port 80?

Thanks.

Status: 
Active

Comments

One thing you could do is create a .htaccess file in your public_html folder, and put the following in it:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://demo.example.com/$1 [R,L]

That will cause any connections on port 80 to redirect to the secured port 443.