我怀疑我的网站发送了错误的 HTTP 标头
这已经困扰我有一段时间了。每当我尝试在 Facebook 或其他链接共享网站上共享我的网站链接时,链接共享网站要么会删除该 URL(就像它无法将其识别为有效),要么在 Facebook 的情况下 - 它无法检索元数据自动地。
我非常确信它曾经有效。然而,通过 Google / StackOverflowing 解决这个问题是一项艰巨的任务,因为我不知道什么可能会导致这个问题。
我尝试在我的网站上创建静态 .HTM 文件,效果很好: test.htm
我的默认主页是经典的 ASP(是的,我知道,PHP 版本正在开发中) )它使用 IIS 7 URL 重写模块。
我尝试检查 test.htm 和我的 默认主页:http://gsitecrawler.com/tools/Server-Status.aspx
这是结果:
test.htm
URL=http://www.orango.nu/test.htm
Result code: 200 (OK / OK)
Content-Type: text/html
Last-Modified: Fri, 04 Feb 2011 10:16:55 GMT
Accept-Ranges: bytes
ETag: "0d877a654c4cb1:0"
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Date: Fri, 04 Feb 2011 10:40:08 GMT
Content-Length: 452
默认主页/
URL=http://www.orango.nu
Result code: 200 (OK / OK)
Cache-Control: public
Content-Length: 13463
Content-Type: text/html; Charset=UTF-8
Accept-Ranges: bytes
Server: Microsoft-IIS/7.0
Set-Cookie: ASPSESSIONIDSCSADCAR=DLPBECCBGDJMADLEPMOMHDDC; path=/
X-Powered-By: ASP.NET
Date: Fri, 04 Feb 2011 10:24:22 GMT
我的 default.asp (/) 文件的前 4 行是:
Response.ContentType = "text/html"
Response.AddHeader "Content-Type", "text/html;charset=UTF-8"
Response.CodePage = 65001
Response.CharSet = "UTF-8"
有人知道可能出现什么问题和/或如何修复它吗?任何帮助或建议将不胜感激,因为这让我走向疯狂的边缘。
This has been bugging me for a while now. Whenever I try to share my website link on Facebook or another link-sharing site, the link-sharing site either removes the URL (like it doesn't recognize it as valid) or in Facebook's case - it can't retrieve meta-data automatically.
I'm pretty sure that it used to work. However, Googling / StackOverflowing for this problem is a difficult task, since I have no idea what possibly could create this problem.
I've tried to create a static .HTM file on my website, and that works fine:
test.htm
My default home page is a classic ASP (yeah I know, PHP version in the works) which uses IIS 7 URL Rewrite module.
I've tried to check the resultcodes and headers for both test.htm and my default home page on this page: http://gsitecrawler.com/tools/Server-Status.aspx
This is the results:
test.htm
URL=http://www.orango.nu/test.htm
Result code: 200 (OK / OK)
Content-Type: text/html
Last-Modified: Fri, 04 Feb 2011 10:16:55 GMT
Accept-Ranges: bytes
ETag: "0d877a654c4cb1:0"
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Date: Fri, 04 Feb 2011 10:40:08 GMT
Content-Length: 452
default home page /
URL=http://www.orango.nu
Result code: 200 (OK / OK)
Cache-Control: public
Content-Length: 13463
Content-Type: text/html; Charset=UTF-8
Accept-Ranges: bytes
Server: Microsoft-IIS/7.0
Set-Cookie: ASPSESSIONIDSCSADCAR=DLPBECCBGDJMADLEPMOMHDDC; path=/
X-Powered-By: ASP.NET
Date: Fri, 04 Feb 2011 10:24:22 GMT
The first 4 lines of my default.asp (/) file are:
Response.ContentType = "text/html"
Response.AddHeader "Content-Type", "text/html;charset=UTF-8"
Response.CodePage = 65001
Response.CharSet = "UTF-8"
Does anyone have an idea what could be wrong and/or how to fix it? Any help or advice would be much appreciated, because this is driving me to the edge of madness.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的主页上的内容类型看起来不正确...
我也不认为至少对于主页而言需要
cache-control: private
标头。The content-type looks wrong on your homepage...
I also don't see the need, at least for the homepage, for the
cache-control: private
header.