简体   繁体   中英

Untrusted connection warning even though my site has a valid certificate

I redirect all URLs on my website to https://www.mysite.tld/… to ensure the connection is secure. But my browser shows an “untrusted connection” warning.

My site has a valid certificate. When I access my website via http://mysite.tld/ (without www. ), no warning is shown.

How can I enable even the www.mysite.tld domain to work with HTTPS without warning, or at least redirect all the URLs to mysite.tld (without www. )?

If your site is displaying untrusted connection warning the domain is blocked by google. ask google groups how to trust your site.

您必须购买ssl证书,或者您可以尝试www.freessl.com

The two most common reasons for this warning are:

  • The website is using a self-signed/free SSL certificate.
  • The website is using a private SSL certificate but it is missing a CA (Certificate Authority) certificate.

The solution in the first case is to purchase a private SSL certificate which is issued for the specific domain by a trusted authority.

The solution in the second case is to have the SSL certificate reinstalled with the correct CA bundle. The CA bundle is provided by the SSL vendor and should be included in the private SSL package.

To redirect http to https just copy and paste the below code to your .htaccess file

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Edit: To redirect to https://example.com use the below one.

RewriteEngine On
RewriteCond %{HTTPS} =on 
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^(.*)$ https://example.com/$1 [R,QSA,L]

the second line checks whether HTTPS is on

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM