我怀疑我的网站发送了错误的 HTTP 标头

发布于 2024-10-16 03:52:20 字数 1687 浏览 6 评论 0原文

这已经困扰我有一段时间了。每当我尝试在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

同展鸳鸯锦 2024-10-23 03:52:20

您的主页上的内容类型看起来不正确...

HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 13463
Content-Type: text/html;charset=UTF-8,text/html; Charset=UTF-8
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Date: Fri, 04 Feb 2011 10:48:39 GMT

我也不认为至少对于主页而言需要 cache-control: private 标头。

The content-type looks wrong on your homepage...

HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 13463
Content-Type: text/html;charset=UTF-8,text/html; Charset=UTF-8
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Date: Fri, 04 Feb 2011 10:48:39 GMT

I also don't see the need, at least for the homepage, for the cache-control: private header.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文