问题描述
我正在测试带有Twitter Cards的页面,并使用Twitters card preview tool测试提供的URL(我正在简化URL,但输出有效):
https://example.net/hello/test-page/
它正在拉卡,但有以下警告:
INFO: Page fetched successfully
INFO: 16 metatags were found
INFO: twitter:card = summary_large_image tag found
INFO: Card loaded successfully
WARN: this card is redirected to http://example.net/hello/test-page/
这里唯一的区别是HTTPS已切换为HTTP。不只是Twitter,还有FB和LinkedIn。
它使用LinkedIn's link preview tool类似地报告:
URL redirect trail
1 301 Redirect https://example.net/hello/test-page/
2 200 Success http://example.net/hello/test-page/
Response Code
200
Fetched URL
https://example.net/hello/test-page/
Canonical URL
http://example.net/hello/test-page/
Redirect Path
Input URL -> https://example.net/hello/test-page/
301 HTTP Redirect -> http://example.net/hello/test-page/
og:url Meta Tag -> https://example.net/hello/test-page/
所以...我检查了生成网页的来源,并且可以确认:
所有与OG和Twitter卡相关的META和LINK标签均未使用“ http”。它们都是“ https”。规范的LINK标记也使用“ https”。
如果我在浏览器中手动转到URL的“ http”版本,它将立即将我重定向到“ https”版本。
谁能解释为什么会发生这种情况,以及我应该开始挖掘的地方?
最后一个示例,当我在Terminal中运行此curl命令时,它似乎也不错:
curl -sLD - https://example.net/hello/test-page/ -o /dev/null -w '%{url_effective}'
HTTP/2 200
server: nginx
date: Sun,23 Aug 2020 16:27:28 GMT
content-type: text/html; charset=UTF-8
strict-transport-security: max-age=31536000
vary: Accept-Encoding
last-modified: Sun,23 Aug 2020 16:23:11 GMT
cache-control: max-age=43,must-revalidate
x-nananana: Batcache-Hit
vary: Cookie
x-ac: 2.ord _atomic_dca
(如果相关,这是一个WordPress网站,但我没有运行任何异常的插件)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)