我的网站很难获得 SSL 认证

Difficulties to get SSL certification in my website

如何在我的浏览器 URL 地址中获得绿色储物柜标志或“安全连接”?

  1. 我的主机 (Ionos) 已经提供了 SSL 证书。

  2. 我的 Wordpress 地址 (URL) 和站点地址 (URL) 都以“https:/”开头,而不是“http:/”

  3. 我还重定向到新的 https:/ URL 在 http:/ 中通过 .htaccess

    的 301 重定向接收到的全部流量
  4. 此外,我已经使用插件“WP Super Cache”删除了 Wordpress 缓存

我还需要什么才能看到绿色储物柜?

你是对的:

1.- 您需要 SSL 认证。您的主机将提供,通常包含在主机包中。

2.- 无论是 Wordpress 还是任何其他 CMS,您都必须将访问者定位到正确的站点,也许在开始时您有一个以 http:/ 开头的 URL,所以如果您想移动到新站点您需要正确寻址到新的 https:/.

的安全站点

3.- 如果您的网站不是新网站并且您想重定向到 https:/ 任何到达 http:/ 的访问者,您可以将正确的代码添加到您的 .thaccess 文件中:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yoursite.com/ [R,L]
</IfModule>}

4.- 请注意,不仅您的站点地址应从 http:/ 移动到 https:/,站点中包含的整个您自己的链接也应移动。目的是:如果您的链接也是安全的,那么您的网站就是安全的。您可以使用更通用的代码来执行此操作:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

5.- 不幸的是,这很可能还不够。请注意,例如您所有发送到 http:/...img 的图像现在都应该发送到 https:/。因此,您必须在源代码中查找 (ctrl + f) http:/(在任何浏览器中尝试确保安全的页面上单击鼠标右键 -->“查看源代码”)。然后编辑与此页面相关的 html 文件,并简单地将每个 http:/ 替换为 https:/

6.- 只有当您确保所有链接都安全时,您的网站才会安全。勇往直前,成功就在尽头。

来源:

https://www.hostinger.es/tutoriales/como-activar-ssl-y-https-en-wordpress/ https://www.hostinger.es/tutoriales/cache-wordpress#Como-borrar-la-cache-en-WordPress