Submitted by sgrayban on Thu, 06/10/2010 - 10:55
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
Submitted by JamieCameron on Thu, 06/10/2010 - 13:56 Comment #1
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]
Submitted by sgrayban on Thu, 06/10/2010 - 14:56 Comment #2
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.
Submitted by JamieCameron on Thu, 06/10/2010 - 15:01 Comment #3
That seems a little unfriendly .. I'd personally recommend my redirect solution, as most users never type in http: or https: .
Submitted by sgrayban on Thu, 06/10/2010 - 15:08 Comment #4
How is that unfriendly ?
If that is what a client of mine wants thats what they get and I get that request often.
Submitted by JamieCameron on Thu, 06/10/2010 - 15:23 Comment #5
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.
Submitted by sgrayban on Sat, 06/12/2010 - 16:31 Comment #6