[Cialug] php $_SERVER['HTTP_REFERER'] and https requests

David Champion dchampion at visionary.com
Tue Aug 14 12:48:59 CDT 2007


If that's the case, this appears to be the default behavior in Firefox &
IE then.

At least in my test environment, the server is nat'ed behind a firewall,
so the IP address in the apache log just shows the firewall's internal IP.

-dc

Daniel A. Ramaley wrote:
> My guess is that the browser chooses not to send a referrer header when 
> switching from https to http pages (or perhaps for anything https 
> related). If the browser fails to send the header, i don't think there 
> is an easy way to generate it. If the https request was accessing a 
> page on the same server i suppose you could grep the log for the 
> client's IP and look for the last thing that is a page (as opposed to 
> an image), but since browsers have back buttons that wouldn't be 
> guaranteed accurate.
> 
> On Tuesday 14 August 2007 11:30, David Champion wrote:
>> Dumb question... I'm checking the $_SERVER['HTTP_REFERER'] in a php
>> page, but if the href comes from a https page, the referrer is empty.
>> Checked the apache access_log shows a "-" where the referrer would be.
>>
>> Is there a way to get the referrer or ip address from a https request,
>> or am I sunk?
> 
> ------------------------------------------------------------------------
> Dan Ramaley                            Dial Center 118, Drake University
> Network Programmer/Analyst             2407 Carpenter Ave
> +1 515 271-4540                        Des Moines IA 50311 USA
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
> 




More information about the Cialug mailing list