大网数据广告活动
网站运营与故障问答

What causes an empty referrer field in a webserver log file?

· 52CE 我爱测

Given a log line from Apache such as the following: xx.xx.xx.xx - - [04/Jan/2016:10:42:27 -0800] "GET / HTTP/1.1" 200 6861 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safa…

问题原文

原帖链接 · mix · CC BY-SA 3.0

Given a log line from Apache such as the following:

xx.xx.xx.xx - - [04/Jan/2016:10:42:27 -0800] "GET / HTTP/1.1" 200 6861 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"

What is the cause of the "-" in the referrer location? I'm guessing that means the information wasn't available, but I'm trying to understand what causes this. Does it mean that this visitor typed the URL directly in the location field of their browser? Does it indicate a bot rather than a human? Or maybe the question should be what are the different actions that could produce the "-"?

已采纳解答

原帖链接 · Stephen Ostermiller · CC BY-SA 3.0

That means that the visitor did not send a referrer for the request. That can happen if:

  • The user was a "direct" visitor and typed the URL into the browser bar or used a bookmark.
  • The user followed a link from outside the browser (for example from an email or mobile app.)
  • The user came to your non-secure http site from a secure https site and the browser hid the referrer for security reasons.
  • The user modified their browser not to send a referrer (such as using a browser extension to hide the information.)
  • The user is using a proxy server that removes referrer headers.
  • The clicked link has an HTML5 rel=noreferrer attribute.
  • A site uses JavaScript to link to your site. Many browsers don't send a referrer when JavaScript uses window.open or location.href to open or set a URL.
  • A page redirects to yours with a meta refresh. Browsers either reset or remove the original referrer with this type of redirect.
  • The request was made by a robot that is not programmed to send referrer information. (Even legitimate robots such as Googlebot often do not send a referrer.)

Google Analytics counts all non-referrer visitors as "direct", as long as they execute the GA JavaScript and don't have an obvious robot user agent. A significant number these "direct" visitors don't send a referrer for some reason other than typing in the URL. We know this because Groupon accidentally dropped out of search engines for a few hours. During this time period they also saw most of their so called "direct" visitors disappear. They could only conclude that most "direct" visitors in Google Analytics were actually search engine referrals.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-01-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。