Remove www from request

If I use https://domain.com is working, but if I use https://www.domain.com is using different certificate at this time the last.

How to make rules for all hosts if request is https://www.domain.com to remove www.

Maybe a regex?..

reqrep ^(https://)(www\.)(.*)$ \1\3

You could do an acl for www. domains and redirect:

acl host_www hdr(host) -m beg www.

If i’m not wrong, You still need the cert for the www domain as the redirect is performed after the SSL handshake. Without this cert, you will get an ssl error.