dongsanhu4784 2014-01-30 11:20
浏览 88
已采纳

是否通过HTTP_REFERER传递了URL的查询段? [原文如此]

A simple enough question unspecific to any web programming language as most use the HTTP protocol and as such are able to retrieve and manipulate the referrer in the HTTP header.

An example:

I am on a webpage and see that the address bar displays example.com/index.php?user=John.

I click a link on the webpage which takes me to inemplum.com.

Say inemplum.com records traffic statistics including the HTTP referrers of its visitors, would this visit show up as example.com/index.php?user=John OR just example.com/index.php? Is this variable i.e. does it depend on the client and/or host OS, browser, language, firewall, etc.? This could perhaps complement the question title to CAN they be.

I know that every other segment can be passed; the protocol, domain, folder path (which in itself has implications) and filename, but this question is focused only on the query data and parameters used in the GET method.

  • 写回答

1条回答 默认 最新

  • doujianchao7446 2014-01-30 14:33
    关注

    From the tests that I have done on my end, local and across multiple servers, the parameters of the referring URL have all been passed to the HTTP_REFERER without any modifications to the servers, hacks, or the like. I did not cross-browser test this, however; I primarily use Firefox.

    A reference from the PHP manual that might help:

    'HTTP_REFERER' - The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.

    If this is purely for analytic tracking, the owner of "inemplum.com" should be able to provide you with a set of custom parameters to append to the URL that would patch directly into their tracking software. For instance, Google Analytic's utm_source=example.com, or Piwik's pk_campaign=whatever.

    In the event that "inemplum.com" is trying to do something with that data, simply pass the necessary parameters over via a standard GET by appending the parameters to the link. For example, inemplum.com/?user=Jon.

    Hope that helps!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料