使用 URL 缩短网站时发现 HTTP_REFERER 为空/空白

发布于 2024-09-18 09:24:36 字数 1121 浏览 5 评论 0原文

我有一位客户试图通过那些“URL 缩短”网站(tinyurl.com、bit.ly 和 x.co)确定其网站的流量指标,并根据该流量采取行动...

我们本以为 HTTP_REFERER 变量会保存引用资源名称,即该服务的缩短 URL。相反,HTTP_REFERER 字段是空的,如果在某些浏览器中读取,它实际上甚至不存在(我猜是 NULL?)。

以下是尝试输入转到我的客户站点的缩短 URL 的示例,页面名称为 x.php:

HTTP_CONNECTION:keep-alive HTTP_KEEP_ALIVE:115 HTTP_ACCEPT:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,application/json HTTP_ACCEPT_CHARSET:ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_ACCEPT_ENCODING:gzip,deflate HTTP_ACCEPT_LANGUAGE:en-us,en;q=0.5 HTTP_COOKIE:ASPSESSIONDQADBDABT=HAEFPIOBONKMOIJFDGNHHEM HTTP_HOST:www.<myclientswebsite>.com HTTP_USER_AGENT:Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 (.NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729) 

为什么不使用 http://x.co 缩短的 URL 显示在标题信息中,还是我没有在正确的位置查找?

我的客户最终希望将传入流量重定向到其网站内的适当资源和/或重定向到他拥有的其他网站。

更新:我查看了他的原始流量日志,除了 x.co 或 bit.ly 等之外我找不到特定的引荐来源网址,我没有看到“/”部分..有什么东西吗我可以在他的 Web 服务器上更改他的 IIS6 设置,这将使我们能够查看并利用他正在寻找的信息,或者我们只是因为 HTTP 重定向的设计而运气不佳?

I have a client who is trying to determine traffic metrics, to his site by way of those "URL shortened" sites: (tinyurl.com, bit.ly and x.co) to be specific, and to take action based on that traffic...

We would have thought that the HTTP_REFERER variable would have held the referring resource name, the shortened URL from that service. Instead the HTTP_REFERER field is empty and if read in some browsers its actually not even there (I guess NULL?).

Here is an example of an attempt to enter a shortened URL that goes to my client's site and the name of the page is x.php:

HTTP_CONNECTION:keep-alive HTTP_KEEP_ALIVE:115 HTTP_ACCEPT:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,application/json HTTP_ACCEPT_CHARSET:ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_ACCEPT_ENCODING:gzip,deflate HTTP_ACCEPT_LANGUAGE:en-us,en;q=0.5 HTTP_COOKIE:ASPSESSIONDQADBDABT=HAEFPIOBONKMOIJFDGNHHEM HTTP_HOST:www.<myclientswebsite>.com HTTP_USER_AGENT:Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 (.NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729) 

Why wouldnt the http://x.co shortened URL show up in the header info OR am I not looking in the correct place?

My client would ultimately like to redirect incoming traffic to the appropriate resource within his website AND/OR out to other sites he owns.

UPDATE: I've looked through his raw traffic logs and I cant find a specific referrer other than x.co or bit.ly, etc I do not see the "/" part.. Is there something I can change in his IIS6 settings, on his web server, that would allow us to see and utilize the information he's looking for, or are we just out of luck due to the design of the HTTP redirect?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

怼怹恏 2024-09-25 09:24:36

由于缩短服务使用响应 301302Location - 没有引用者。您的浏览器无法通过它。

Because the shortening services use response 301 or 302 and Location - there is no referer. Your browser does not pass it.

不回头走下去 2024-09-25 09:24:36

HTTP_REFERER 是一个可选标头。在某些情况下,它们会被删除(安全软件、代理等)。

对于 URL 缩短服务,它们可能会执行标头重定向,并且根本不包含 HTTP_REFERER。

HTTP_REFERER is an optional header. In some cases they are stripped out (security software, proxies, etc).

In the case of URL shortening services, they probably do a header redirect and simply don't include HTTP_REFERER.

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