Re: Using mod_perl to modify referer...
"Brian" <[EMAIL PROTECTED]> writes: > I have a unique situation in which I need to change the http_referer. > What I've done is written a quick script that looks like this: [snip] > > Now, the problem is this: It works perfectly as long as the client > remains on our server. But, if they go to another domain the referer > reverts back to what it was before. I need to change it, and have it > stay changed. Is there ANY way of doing this with mod_perl? Any help > is appreciated. I've been beating my head on the desk for a while here. > :o) > There is no way to do this. The REFERER field is set by the web client and can not be altered by the server. Once it's sent to the server as part of a HTTP request, the server is free to modify it as it sees fit (as you've done in mod_perl), but it can not tell the client to adopt this new value. Two possible workarounds would be to direct hyperlinks to an intermediate page which in turn redirects the client the final destination. That should set the REFERER correctly to the intermediate page (though perhaps not for 302 redirects). Another possibility would be to abandon using the REFERER field altogether. Use a cookie to encode the necessary information or encode it in the query string of the request itself.
Using mod_perl to modify referer...
I have a unique situation in which I need to change the http_referer. What I've done is written a quick script that looks like this: package BnP::Referer; use Apache; use Apache::Constants; sub handler { my $r = shift; $r->header_in('Referer' => "http://www.somedomainname.com";); return OK; } 1; And then setup a handler in the httpd.conf file that looks like this: PerlModule BnP::Referer PerlFixupHandler BnP::Referer Now, the problem is this: It works perfectly as long as the client remains on our server. But, if they go to another domain the referer reverts back to what it was before. I need to change it, and have it stay changed. Is there ANY way of doing this with mod_perl? Any help is appreciated. I've been beating my head on the desk for a while here. :o) Brian Johnson Partner/Systems Administrator/Programmer Source1Hosting.tv, LLC (www.source1hosting.tv) Source1Results.com, LLC (www.source1results.com) I may be insane, but remember - The only difference between an insane man and a genius is his jacket.