问题标签 [referer]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
470 浏览

javascript - 子域中的引用者

我需要在具有许多子域的域上使用谷歌分析,但它们都应该在主域内。

像这样:
我的网站:a.com
订阅者:xacom、yacom、zacom
他来自:google.com

假设用户从 xacom 开始,然后他点击某些东西并转到 yacom,最后,他最终在 zacom 购买了东西。
我想知道,如果我能知道他来自谷歌,那么我们可以确定把钱放在哪里。

谢谢,
乔纳森

0 投票
2 回答
806 浏览

windows-phone-7 - WP7 和 Http-Referer

我编写了一个显示来自 Disqus 的评论的应用程序,当我将它作为 .NET 应用程序在我的桌面上运行时,它运行良好。它发送一个 http 请求,然后反序列化 json 对象。但是,当我将代码移动到我的 Windows Phone 应用程序时,我从 Disqus 收到错误消息。

似乎因为 Windows Phone 决定添加一个随机的 http 引用者,所以我的请求失败了。我不允许在 Windows Phone 上更改引用者 我收到消息“无法直接修改‘引用者’标头。” 如果我尝试这样做。

是否有不需要我构建删除引用标头的代理的解决方法?

0 投票
1 回答
550 浏览

php - 页面刷新后显示不同的内容

.php 页面检查引用者是否来自 xdomainname.com,如果是 iframe 页面 X,如果不是 iframe 页面 Y。

问题是如果刷新 .php 页面(仅在第一次加载时 iframe 页面 X/Y),我想重定向到另一个页面。

我尝试添加缓存标头,但 .php 页面仍然是 iframe 页面 X/Y - 取决于引用者。

除了 cookie 之外,是否有任何解决方法来清除引荐来源帖子数据或检测第一页加载(可能创建一个隐藏字段并在第二个页面加载时检测其值)?

0 投票
3 回答
235 浏览

php - 可以从 PHP 中的引用者那里获取低级信息

PHP是否可以确定以下场景:

服务器“A”:我不拥有或控制服务器。我可以将此服务器上的网络链接发布到我的服务器。

服务器“B”:我自己的运行 PHP 和 Apache 的服务器。

:我想在服务器“A”上发布一个链接,当我点击链接并点击服务器“B”时,我想尽可能地检索有关原始链接的所有信息。包括为访问我的服务器而进行的 Ajax 调用。HTTP_REFERER 没有给我我需要的信息。

当我在应用程序 UI 中运行 Charles 或 Fiddler 时,我看到了我需要的 GET 请求。但我不确定 PHP 是否能够在我概述的场景中自动“逆向工程”这个请求。

想到的一些事情(可能不符合实际)

CURL referrer 反向代理 Charles/Fiddler2

0 投票
3 回答
2968 浏览

php - Any way to capture the referring t.co link from Twitter?

I want to post multiple versions of the same link on Twitter but I want to capture them with unique identifiers when they hit my server.

Twitter partially devised a mechanism for this, for example if I post www.example.com into a twitter message, Twitter will automatically resolve it into a custom URL beginning with t.covia a 301 re-direct.

more information: Twitter Link Wrapping

I want to capture this re-directed URL so I can have a unique identifier for similar links on Twitter.

Is there a way to do it? Or is there a better way to handle this problem?

(I'm looking for a solution in PHP/JS or if need be any possible way with any language)

EDIT: The link needs to be exactly the same in Twitter, can't have query parameters or hash on the link.

EDIT2: More investigation, the t.co link will remain the same if it's the same link url attributed to the same profile. For example, two links of www.example.com on the same twitter profile will yield the same t.co link, but the t.co link will be different if it's attributed to another profile. I guess this to mean even if there is a workaround for the above issue, there is still no way to differentiate exactly the same links on the same twitter profile server side.

EDIT3 12/26/11 whats interesting too is that t.co differentiates between http:// and https so you can in theory 'display' two of the same links on the same profile and they will look physically the same in Twitter but the t.co redirect link will be different. It will link to the http and https versions.

  • Ultimately, what I'm trying to do is find out the tweet i.d of of a referring link that hits my server without resorting to URL params.
0 投票
2 回答
5490 浏览

magento - 获取 Magento 上一页的标题和网址

我正在尝试获取客户在 Magento 中访问的上一页的标题和 url。我们可以通过 $ _SERVER ['HTTP_REFERER'] 变量获取 URL,但不确定如何获取它的标题。不胜感激有关此问题的任何帮助,或者可能是如何在 Magento 中显示上一页(网址 + 标题)的不同方法

0 投票
2 回答
4379 浏览

php - 通过 AJAX 获取在您的服务器上调用 PHP 文件的域

我正在构建一个 API,并且有一个关于如何跟踪/知道哪些域使用该调用的问题。

API 调用是用 PHP 构建的,不需要任何身份验证。用户很可能会在其服务器上的 AJAX 调用中使用 API。

例如,我提供 API PHP 文件的域称为 dev.yourmapper.com。域 www.metromapper.org 上的某个人构建了一个页面,该页面创建了一个 Google 地图,并使用 Ajax 调用我的文件以将我的数据覆盖在他们的地图上。

这是该示例:http ://www.metromapper.org/example/apitest.htm

(单击中心地图标记可查看适用于 yourmapper.com 脚本的所有 PHP 服务器变量的弹出窗口。)

请注意,如果您单击链接,HTTP_REFERER 可能会是“stackoverflow.com”(如果您剪切并粘贴链接,则为空)。我认为引用者将是 metromapper.org,因为该域在加载后调用 yourmapper.com 脚本,但显然不是。

底线:我可以使用什么方法来确定哪个域正在使用 Javascript 调用我的 yourmapper.com 脚本?如果需要,我可以使用 PHP 以外的其他语言。谢谢。

0 投票
1 回答
1901 浏览

php - 使用 php header( 'Location: ') 设置引荐来源网址

有没有办法用 header('Location:') 命令伪造引荐来源网址?

0 投票
4 回答
805 浏览

installation - 如何跟踪软件下载源

这就是问题所在。我们有一些软件,有免费版和付费版。

该软件是一个安装软件的EXE下载。我们希望获得最大销量的方式是人们下载免费版,然后通过软件中的各种链接决定他们现在愿意为它付费并解锁新功能。

目前,我们开展了多项活动以吸引访问者访问我们的网站。我们知道访问者来自我们的 Reddit 活动,下载了我们的软件,然后他们的所有意图和目的都消失了。如果他们使用该软件并希望付款,他们单击该软件中的链接并且购买是匿名的。

我们想要做的是当他们下载软件时,它会以某种方式在他们的安装目录中生成一个文本文件,其中包含他们的下载源。该文件将包含诸如“reddit1”之类的数据,以表明它们来自 reddit 活动 #1。然后软件中的每个链接都会在 GET 请求中发送该变量,以便我们知道销售的实际来源。

我们想不出最好的方法是,当我们在网站上拥有包含其源代码的变量时,如何将其传递给 EXE 下载,以便在安装过程中生成数据文件?我们不希望我们运行的每个广告系列都有多次下载。

0 投票
5 回答
6377 浏览

asp.net - URL Referer 在弹出窗口上不起作用

我有两页www.abc.com/pg1.aspx,即www.abc.com/pg2.aspx

UrlReferrer工作正常。

UrlReferrerNULL

我搜索了解决方案。但他们都没有导致我想要的解决方案。

我的问题是,如果窗口没有菜单栏、状态或工具栏,UrlReferrerNULL

如果没有,UrlReferrer有上一页的 URL。

我也试过url_refer = Request.ServerVariables["HTTP_REFERER"].ToString();代替string url_refer = Request.UrlReferrer.ToString();.

结果是一样的。

有什么解决办法吗?