Redirect and create HTTP Referer

This is a discussion on Redirect and create HTTP Referer within the PHP Language forums, part of the PHP Programming Forums category; Please excuse me if my explanation is somewhat coarse. I'm obviously new to PHP ;) Some external sites linking to ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-18-2004
Hans Vallden
 
Posts: n/a
Default Redirect and create HTTP Referer

Please excuse me if my explanation is somewhat coarse. I'm obviously
new to PHP ;)

Some external sites linking to our site do not send the HTTP Referer
information. I would like to be able to track the referrals from these
sites and have them logged into Apache's log lines (combined log
format) as the appropriate referrer (%{Referer}i\).

My initial idea was to create a separate redirect page to give to these
external sites. But the redirect page would also need to pass on the
FQDN of the external site as the HTTP Referer for the Apache log to
pick up.

I tried a redirect page http://www.mysite.com/redirect.php with code:

<?php
header("Referer: http://www.externalsite.com/index.html");
header("Location: http://www.mysite.com/index.php");
exit;
?>

....and redirect works good but the referrer isn't passed on to the
Apache log.

So, can anyone help me in my search for the truth? :)
Reply With Quote
  #2 (permalink)  
Old 01-18-2004
John Dunlop
 
Posts: n/a
Default Re: Redirect and create HTTP Referer

Hans Vallden wrote:

> Some external sites linking to our site do not send the HTTP Referer
> information.


Websites don't send referrer information. The Referer header is used
by the client to send to the server "the address (URI) of the
resource from which the Request-URI was obtained" (RFC2616, sec.
14.36). The Referer header is a request-header, not a response-
header. It is therefore up to the client whether a Referer header is
sent or not.

--
Jock
Reply With Quote
  #3 (permalink)  
Old 01-18-2004
Hans Vallden
 
Posts: n/a
Default Re: Redirect and create HTTP Referer

In article <MPG.1a749fa09c43436d9897f5@news.freeserve.net>, John Dunlop
<john+usenet@johndunlop.info> wrote:

> Hans Vallden wrote:
>
> > Some external sites linking to our site do not send the HTTP Referer
> > information.

>
> Websites don't send referrer information. The Referer header is used
> by the client to send to the server "the address (URI) of the
> resource from which the Request-URI was obtained" (RFC2616, sec.
> 14.36). The Referer header is a request-header, not a response-
> header. It is therefore up to the client whether a Referer header is
> sent or not.


Okay, thanks! :)

I think the external sites in question have links setup in a way which
opens our page into a new empty window. And if I'm correct, that causes
the browser not to send the header.

So, my logfile analysis program can count the log requests to the
redirect page and display them in the pages section, but I can't get it
to display them in the referrals section like I would want to and like
most of the other significant external referrers are being displayed.
Or can someone suggest another approach to this problem? Apache
directives?
Reply With Quote
  #4 (permalink)  
Old 01-18-2004
Chung Leong
 
Posts: n/a
Default Re: Redirect and create HTTP Referer

No. The browser does send the referer url when the page is displayed in new
window.

People are probably just typing in the url to your site.

Uzytkownik "Hans Vallden" <foridiotsonly@vallden.com> napisal w wiadomosci
news:180120041615484295%foridiotsonly@vallden.com. ..
> Okay, thanks! :)
>
> I think the external sites in question have links setup in a way which
> opens our page into a new empty window. And if I'm correct, that causes
> the browser not to send the header.
>
> So, my logfile analysis program can count the log requests to the
> redirect page and display them in the pages section, but I can't get it
> to display them in the referrals section like I would want to and like
> most of the other significant external referrers are being displayed.
> Or can someone suggest another approach to this problem? Apache
> directives?



Reply With Quote
  #5 (permalink)  
Old 01-18-2004
John Dunlop
 
Posts: n/a
Default Re: Redirect and create HTTP Referer

Chung Leong wrote upsidedown:

> No. The browser does send the referer url when the page is displayed in new
> window.


It might; it might not. A Referer header is not obligatory in a
request. Not only can the client choose whether to send referrer
information, but intermediary applications can have a say too.

> People are probably just typing in the url to your site.


Possibly, in which case the sending of a Referrer field would
contravene a "MUST level requirement" of RFC2616.

--
Jock
Reply With Quote
  #6 (permalink)  
Old 01-18-2004
John Dunlop
 
Posts: n/a
Default Re: Redirect and create HTTP Referer

Chung Leong wrote upsidedown:

> No. The browser does send the referer url when the page is displayed in new
> window.


It might; it might not. A Referer header is not obligatory in a
request. Not only can the client choose whether to send referrer
information, but intermediary applications can have a say too.

> People are probably just typing in the url to your site.


Possibly, in which case the sending of a Referer field would
contravene a "MUST level requirement" of RFC2616.

--
Jock
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:15 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0