gpt4 book ai didi

html - 将混合内容 http 转换为 https

转载 作者:太空宇宙 更新时间:2023-11-03 14:36:41 24 4
gpt4 key购买 nike

我最近在我的网站上添加了一个 ssl 证书。现在的问题是一些元素,如图像、字体等是在 "src=http://example.com/jpg" 标签中使用 http 的外部内容。

我知道我可以通过在元素标记中将 http 替换为 https 来解决问题,但我至少有 133 个网页需要一段时间手动完成。

我可以使用其他替代方案吗?

我可以使用 .htaccess 来解决这个问题吗?

注意 - 我正在使用 cpanel 托管

最佳答案

试试这个

RewriteEngine On

### WWW & HTTPS

# ensure www.
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# ensure https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

### WWW & HTTPS

关于html - 将混合内容 http 转换为 https,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47221525/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com