.htaccess: non www to www (with https) shows ssl_error_bad_cert_domain in Firefox

I have a redirection problem and could not find a solution on the whole network ...

The right domain is: https://www.fit-for-easa.com The following redirections DO work: http://fit-for-easa.com to https://www.fit-for-easa.com http://www.fit-for-easa.com to https://www.fit-for-easa.com But the problem is with: https://fit-for-easa.com In Chrome it is forwarded correctly to https://www.fit-for-easa.com - but not in Firefox what seems very strange to me. Firefox shows ssl_error_bad_cert_domain. 

This is my .htaccess file:

 AddType image/svg+xml svg svgz AddEncoding gzip svgz <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://www.fit-for-easa.com%{REQUEST_URI} [L,R=301] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> 

Maybe the problem is that the certificate is only for the www version, but not for the non-www version? And what does Firefox do this critically while Chrome ignores it?

Thank you for your help!

(Sorry, I marked the text as code, but I don't have enough reputation to post more than two links - I'm working on it!)

+5
source share
1 answer

In Chrome, it is correctly redirected to https://www.fit-for-easa.com - but not in Firefox, which seems very strange to me. Firefox shows ssl_error_bad_cert_domain.

It does not work in Chrome for me. Maybe this worked for you because you added the exception earlier. The reason is simple: the name fit-for-easa.com not included in the certificate, but only the name with the www prefix. From certificate:

  Subject: OU=Domain Control Validated, OU=PositiveSSL Multi-Domain, CN=3wertig.com ... X509v3 Subject Alternative Name: DNS:3wertig.com, DNS:www.fit-for-easa.com, DNS:www.steuerberatung-zodel.de 

To redirect from https://fit-for-easa.com to any other site, your certificate must include the name specified in the URL, i.e. fit-for-easa.com , not www.fit-for-easa.com . No htaccess settings or DNS settings can get around this, but the certificate needs to be fixed.

+3
source

Source: https://habr.com/ru/post/1237942/


All Articles