Redirecting https://www to https://non-www - without seeing certificate error, possible?

前端 未结 1 1718
终归单人心
终归单人心 2020-12-16 23:34

So my SSL certificate only applies to https://example.com - not https://www.example.com (can\'t complain, it was free).

After venturing into mod_re

相关标签:
1条回答
  • 2020-12-17 00:14

    Is there a way to prevent traffic to hit your server the improper way (https:// www) before the browser gives out a certificate error?

    No, there's nothing you can do, your assessment is correct that the browser looks at the server certificate and sees that the host doesn't match and displays the error. The error isn't generated by the server, and this happens before a request is even sent to the server. This happens during the SSL handshake. The only things you can do are prevent any http://www links from existing, or buy a new certificate that includes "www".

    As for your rules, there's really no way to simplify it since you have multiple conditions for each rule.

    0 讨论(0)
提交回复
热议问题