Bluehost.com Web Hosting $6.95

Modifying User Agent with mod_rewrite

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 ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-21-2003
Martin Auer - NetAge Solutions GmbH
 
Posts: n/a
Default Modifying User Agent with mod_rewrite

Hello,

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"

Thanks a lot,
Martin
  #2 (permalink)  
Old 12-22-2003
Joachim Ring
 
Posts: n/a
Default Re: Modifying User Agent with mod_rewrite

> 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
  #3 (permalink)  
Old 01-19-2004
Martin Auer - NetAge Solutions GmbH
 
Posts: n/a
Default Re: Modifying User Agent with mod_rewrite

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

 
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 01:02 AM.


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