HTTP_REFERER empty when referrer shown in DOM logs

ttremain

Well-Known Member
Feb 16, 2003
246
2
168
cPanel Access Level
Root Administrator
I do not know of any better place to post this, but since the server is built under cPanel, with
Apache/PHP configured using EasyApache, I guess I'm posting here.

I am not sure why, but many visitors I get, have a referrer shown in the DOM logs (/usr/local/apache/domlogs/domain.com) but upon their first visit, nothing shows up in PHP under $_SERVER['HTTP_REFERER']

This is not always the case, but it is happening quite often.

I am stumped.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello :)

This is documented by PHP:

PHP: $_SERVER - Manual

Here is a snippet:

'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.
Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Could you open a support ticket using the link in my signature so we can reproduce the issue and see what could be happening? You can post the ticket number here so we can update this thread with the outcome.

Thank you.
 

ttremain

Well-Known Member
Feb 16, 2003
246
2
168
cPanel Access Level
Root Administrator
I'm not sure I can reproduce at will. It seems to be happening with a small % of visitors. I was just hoping someone had seen such a thing, and had any ideas for me. For the moment I will try to assume it's my own code causing the problem, until I can find a way to isolate it and/or generate some better logs of it happening.