This is a discussion on Modifying User Agent with mod_rewrite within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hello, is it possible to set the user agent to static value with mod_rewrite? So, every requesting user agent should ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
> is it possible to set the user agent to static value with mod_rewrite?
> > So, every requesting user agent should be rewritten to anything like > "NotExistingBrowser" with apache2 it's easy, use RequestHeader set User-Agent "NotExistingBrowser" this replaces the actual header and will therefore also work in forward or reverse proxy situations. with apache 1.3 you don't have RequestHeader. you could try to set the environment variable HTTP_USER_AGENT to some value which might or might not work (probably depending on module loading order) for cgis, ssi or php in that same webserver instance - i have no 1.3 installation on hand to test it. anyway the line is: RewriteRule .* - [E=HTTP_USER_AGENT:NotExistingBrowser] joachim |
|
|||
|
On 21 Dec 2003 16:22:23 -0800, Joachim Ring <jring@web.de> wrote:
>> is it possible to set the user agent to static value with mod_rewrite? >> >> So, every requesting user agent should be rewritten to anything like >> "NotExistingBrowser" > >with apache 1.3 you don't have RequestHeader. you could try to set the >environment variable HTTP_USER_AGENT to some value which might or >might not work (probably depending on module loading order) for cgis, >ssi or php in that same webserver instance - i have no 1.3 >installation on hand to test it. anyway the line is: > >RewriteRule .* - [E=HTTP_USER_AGENT:NotExistingBrowser] OK, I have an apache 1.3 I tried the line you posted above, but it wouldn't work. In the ethereal sniff I saw the original Mozilla/4.0 (compatible ...) So I tried to do something like: RewriteRule ^/exchweb(.*)$ http://10.1.1.9/exchweb$1 [E=HTTP_USER_AGENT :NotExistingBrowser,P,L] but this also didn't work. Can you please help me again? Thanks, Martin > >joachim |