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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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? :) |
|
|||
|
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 |
|
|||
|
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? |
|
|||
|
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? |
|
|||
|
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 |
|
|||
|
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 |