Reputation: 986
We have a setup with a wildcard SSL setup for *.example.com so each type a user types myapp1.example.com or myapp5.example.com or myappstackoverflow.example.com
Everything is working fine.
However from time to time, some users are typing www.myapp5.example.com adding the www prefix.
I would like to know if there is a way to redirect www.*.example.com requests to *.example.com requests
thank you
Upvotes: 0
Views: 37
Reputation: 123260
Since your certificate is for *.example.com
only it will not match whatever.*.example.com
. This means the user will be confronted with a certificate warning before there is even a chance to redirect the user to a different domain.
In other words: what you want is not possible with your current certificate. You would need a certificate which does cover the all the variants your users might enter, i.e. *.*.example.com
. Only, multi-level wildcard certificates are not possible and thus the most you can do is to get a certificate covering the most common errors of your users but not arbitrary subsub-domains.
Upvotes: 1