The referrer, or HTTP referrer — also known by the common misspelling referer that occurs as an HTTP header field — identifies, from the point of view of an Internet webpage or resource, the address of the webpage of the resource which links to it. By checking the referrer, the new webpage can see where the request originated.
Questions tagged [http-referer]
564 questions
198
votes
5 answers
In what cases will HTTP_REFERER be empty
I know it's possible to get an empty HTTP_REFERER. Under what circumstances does this happen? If I get an empty one, does it always mean that the user changed it? Is getting an empty one the same as getting a null one? and under what circumstances…

sameold
- 18,400
- 21
- 63
- 87
120
votes
10 answers
Getting the HTTP Referrer in ASP.NET
I'm looking for a quick, easy and reliable way of getting the browser's HTTP Referrer in ASP.Net (C#). I know the HTTP Referrer itself is unreliable, but I do want a reliable way of getting the referrer if it is present.

Chuck Le Butt
- 47,570
- 62
- 203
- 289
112
votes
4 answers
Get original URL referer with PHP?
I am using $_SERVER['HTTP_REFERER']; to get the referer Url. It works as expected until the user clicks another page and the referer changes to the last page.
How do I store the original referring Url?

Keith Donegan
- 26,213
- 34
- 94
- 129
106
votes
5 answers
Determining Referer in PHP
What is the most reliable and secure way to determine what page either sent, or called (via AJAX), the current page. I don't want to use the $_SERVER['HTTP_REFERER'], because of the (lack of) reliability, and I need the page being called to only…

UnkwnTech
- 88,102
- 65
- 184
- 229
96
votes
5 answers
Will a 302 redirect maintain the referer string?
I need to redirect the user from one page to another, but I need to maintain the original referer string. So, for example, if they start out on http://www.othersite.com/pageA.jsp, click a link that takes them to http://www.example.com/pageB.jsp,…

sangfroid
- 3,733
- 11
- 38
- 42
71
votes
1 answer
How to get "HTTP_REFERER" with NodeJS?
A way to get HTTP_REFERER , We can use document.referrer in browser side javascript .
But how can we get it in NodeJS ?

Enkows
- 715
- 1
- 5
- 7
42
votes
1 answer
How reliable is HTTP_REFERER?
I need to check and record the referrer of visitors to my web application. How reliable is using HTTP_REFERER? And are there other alternatives?

willz
- 2,020
- 3
- 21
- 24
38
votes
2 answers
Can I rely on Referer HTTP header?
Can I rely on Referer HTTP header in my web application? I want to check if the user came from a particular domain/webpage, and if he or she did, then change the layout of my site accordingly.
I know that people can disable Referer in their…

bodacydo
- 75,521
- 93
- 229
- 319
33
votes
3 answers
Ajax request: Refused to set unsafe header
I am trying to play an audio using Google Text-To-Speech. Therefore I need to post a request to their endpoint with the Referer and the User-Agent properly set. This call should return an MP3 that I can play.
However, I get Refused to set unsafe…
user411103
33
votes
2 answers
Get referring URL for Flask request
When a user visits our site and signs up, how can I capture which website they came from?
Be it search, a PR website, etc. I don't care what page from our site they visited, I just want to know which marketing efforts are giving us the most…

Robert Guice
- 609
- 1
- 5
- 12
32
votes
1 answer
How to get HTTP-Referer via JS | Jquery?
Is it possible to get the http-referer of visitors via pure JS or with JQuery?

Za Noza
- 438
- 1
- 4
- 8
31
votes
8 answers
How to get the http referer in laravel?
I'm trying to get the Referer of my users. Like if they come from facebook, youtube, google or anything else.
Now I've tried something like that:
$referrer = $this->request->headers->get('referer');
$url = $referrer ? $this->to($referrer) :…

PHPprogrammer42
- 355
- 1
- 3
- 7
31
votes
3 answers
Does 301 redirect always preserve referrer?
I want to know whether 301 redirect always preserve referrer.
I make a page called "gotoorig_https.html" which contains a hyperlink to a page "orig_https.asp".
"orig_https.asp" will 301 redirect to "dest.html" which shows the document.referrer.
In…

Billy
- 15,516
- 28
- 70
- 101
30
votes
4 answers
How do I select only the root domain from $_SERVER['HTTP_REFERER'];?
I want to have a 404 page that can detect if a user has come to that page either via my site, via my shortened URL or via another site, and I am making it using PHP. I am slowly getting to grips with PHP and this may well be a simple question, but…

Nathan Bunn
- 597
- 1
- 7
- 14
29
votes
2 answers
Get querystring from URLReferrer
I am trying to get the QueryString value like this Request.QueryString("SYSTEM") from a UrlReferrer. I see i can use this Request.UrlReferrer.Query() but it doesn't allow me to specify the exact parameter
I could parse the Query() value, but I want…

FarFigNewton
- 7,108
- 13
- 50
- 77