wordpress - 如何将img url中的http转为https

标签 wordpress ssl nginx https woocommerce

我已经在我的网站上实现了 https。 我的网上商店的产品说明中的多个页面上有以下 html 代码:

<img src="http://www.example.com/img.png" >

它在 woocommerce 中,但我不知道如何在我的数据库(在 phpmyadmin 中)中替换它,所以我想将 nginx 重写为 https。 以下 nginx 配置:

... omited...


         if ($ssl_protocol = "") {
       rewrite ^   https://www.example.com$request_uri? permanent;
    }
        location / {
                try_files $uri $uri/ /index.php?$args;
        }


... omited...

我怎样才能使 src="http://..."以 ssl url 结束,从而消除错误?

最佳答案

这不是您可以在 nginx 中真正解决的问题。出于同样的原因,重定向本身将通过 HTTP 提供并在加载之前被浏览器阻止。

关于wordpress - 如何将img url中的http转为https,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28354924/

相关文章:

nginx - 在 kubernetes pod 中重新加载 nginxconf

nginx - Kubernetes 中来自 ConfigMap 的自定义 nginx.conf

php - JQuery AJAX 发布并刷新页面内容,无需重新加载页面

java - 如何在 JAX-WS 客户端中禁用证书验证?

php - Wordpress - 为特定菜单定制 wp_nav_menu

algorithm - 如何验证 ssl 证书?

iphone - https 连接是否自动使用 ssl 加密数据

django - 使用 Django、Nginx、Gunicorn 和 supervisor 进行空日志记录

php - 编辑主题以应用 Co-Authors Plus

使用 Mercurial 进行 WordPress 开发。整个树还是子存储库的集合?