SSL only site creation

See post https://www.virtualmin.com/node/14420

I don't see why a new feature like this can't be added...

Currently you have:

Apache website enabled
SSL website enabled

Why can't they be exclusive of each other ? Makes no sense something like this can't be done, half of the code is already there.

I often have people asking me how to prevent the use of port 80 completely when creating a SSL site. Yes I know you can add a htaccess file to do this but some clients don't want port 80 listening at all so I have to go into the apache config for the domain and remove the whole virtual settings for it.

Status: 
Closed (fixed)

Comments

Technically this could be done, but it would be a fair bit of work as Virtualmin currently assumes that every domain with a website has a non-SSL site.

Also, if a domain didn't have a non-SSL site, what would happen when users connect using the http: URL? Most likely they would get the default domain on the system, which wouldn't be too useful.

Why not instead create a template that for non-SSL requests simply does a redirect to https://www.domain.com/ ?

This could be done with Apache directives in the template like :

RewriteEngine On
RewriteCond %{SERVER_PORT} !443
RewriteRule (.*) https://www.${DOM}/ [R]
what would happen when users connect using the http: URL?

Nothing since all SSL sites already have there own IP which VM assigns so if port 80 isnt open for that IP then the browser would simply show a no connection error.

That seems a little unfriendly .. I'd personally recommend my redirect solution, as most users never type in http: or https: .

How is that unfriendly ?

If that is what a client of mine wants thats what they get and I get that request often.

I meant unfriendly for visitors to the site .. it seems to me that it would be better for it to just work in both SSL and non-SSL modes, by forcing a redirect to the https: URL.

However, if that isn't what your clients want, there unfortunately isn't any other solution I can offer in Virtualmin right now.