Paul Groves wrote:
On 11/10/18 16:59, Per Jessen wrote:
Paul Groves wrote:
Hi All,
So I have just set up ssl on my new web server as you may have seen from my other thread.
Now in the default apache config for HTTP I have simply added the following to redirect to the virtualhost I wish to see as default: RewriteEngine on RewriteCond %{SERVER_NAME} =www.mysite.com
s/=/!/ ?
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
So now what happens when I type in the IP or local hostname of the server, and by extension any other ServerName which is not defined in the apache config, I get redirected to www.mysite.com
But I wish to achieve this with the default HTTPS site too. snip] So my question is, how can I redirect all HTTPS requests by default to my www.mysite.com site without getting certificate errors? Can this be done?
Nope, can't be done.
Well that is a pain. I imagine this would be a very useful feature to a lot of people.
The reason it does not work is - in comparison to http, when you are using https, you first need an encrypted connection. This can only be established if the site you are visiting can be properly identified and provided it has a certificate to match the name. For a default vhost you would need a certificate to match all the (otherwise unmatched) possible names and addresses. -- Per Jessen, Zürich (12.4°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org