Mod_rewite HTTP_USER_AGENT with RewriteMap

This is a discussion on Mod_rewite HTTP_USER_AGENT with RewriteMap within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hi group, OK so I'm trying to append a query string [QSA] based on a partial user agent match. ...


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 08-19-2005
jason@onspeed.com
 
Posts: n/a
Default Mod_rewite HTTP_USER_AGENT with RewriteMap

Hi group,

OK so I'm trying to append a query string [QSA] based on a partial user
agent match. The match is to distinguish screen based browsers from
handheld browsers. Now I'd like to do this through a RewriteMap.

At the moment I have this:

RewriteMap agent_compact txt:/etc/httpd/conf/sites/useragentCompact.map
RewriteCond %{%{HTTP_USER_AGENT}:agent_compact|MISS} !=MISS
RewriteRule ^/(.+)$ /$1?mode=${agent_compact:$1|compact} [QSA]

However I'm unclear as to the form the *.map file should take, I'
assuming something like?:

Firefox default
up.Browser compact

Is this right? I also think my RewriteCond and RewriteRule is flawed.

TIA

 
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 04:19 AM.


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