mod_rewrite: RewriteMap & HTTP_USER_AGENT

mod_rewrite: RewriteMap & HTTP_USER_AGENT

Post by Marc Roger » Sat, 23 Mar 2002 18:24:13



Hi

Having spent the better part of a day wrestling with mod_rewrite I find
myself making little headway.

I am attempting to convert the following example into rewritemap format:

RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/3.*
RewriteRule ^foo\.html$         foo.NS.html          [L]
RewriteCond %{HTTP_USER_AGENT}  ^Lynx/.*         [OR]
RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/[12].*
RewriteRule ^foo\.html$         foo.20.html          [L]
RewriteRule ^foo\.html$         foo.32.html          [L]

It doesnt seem to work however, and im wondering if rewritemap is breaking
on the unescaped characters
in the HTTP_USER_AGENT string. Has anyone out there got a working example of
a rewritemap using
HTTP_USER_AGENT?

Marc

 
 
 

mod_rewrite: RewriteMap & HTTP_USER_AGENT

Post by Joshua Sliv » Sun, 24 Mar 2002 00:17:20



Quote:> Hi
> Having spent the better part of a day wrestling with mod_rewrite I find
> myself making little headway.

See:
http://httpd.apache.org/docs/misc/FAQ.html#rewrite-dontwork

--
Joshua Slive

Apache HTTP Server Users Mailing List: http://httpd.apache.org/userslist.html

 
 
 

mod_rewrite: RewriteMap & HTTP_USER_AGENT

Post by Derek Yeu » Sat, 30 Mar 2002 05:18:06


Hi all,

I apologize for the stupidity of my question, but i have spent the
better part of the week trying the de-mystify RewriteMap.

I would like to know how to approach this:
my situation is that i must rewrite this way:

http://host.domain.ext/keyword  ->
https://host.domain.ext/some/long/path/keyword

however, there are many keywords.  Can someone please provide some
assistance?  i would really really appreciate this.

all the examples on the web i've been able to locate using google has
only showed examples with http_referrers or very complex variables.

Thanks,
-derek



> > Hi

> > Having spent the better part of a day wrestling with mod_rewrite I find
> > myself making little headway.

> See:
> http://httpd.apache.org/docs/misc/FAQ.html#rewrite-dontwork

 
 
 

mod_rewrite: RewriteMap & HTTP_USER_AGENT

Post by Jorey Bum » Sat, 30 Mar 2002 05:36:46



> I would like to know how to approach this:
> my situation is that i must rewrite this way:

> http://host.domain.ext/keyword  ->
> https://host.domain.ext/some/long/path/keyword

Redirect /keyword https://host.domain.ext/some/long/path/keyword
 
 
 

1. Help with mod_rewrite and rewritemap

My site has some filenames with 2 or more spaces.
Some search engines substitute them with some + but in this way their
request can't reach the pages.
I am trying to use mod_rewrite to change the request substituting the
filename with + with the filename with %20.
I am trying to use a rewrite map but I'm not able to make it work.
This is what I wrote in the httpd.conf:

RewriteEngine On
RewriteLog "/home/mhd/rewrite.log"
RewriteLogLevel 9
RewriteMap berno     txt:/home/mhd/map.txt
RewriteRule ^/home/mhd/prova/www.domain.it/htdocs/(.*)
/home/mhd/prova/www.domain.it/htdocs/${berno:$1|$1}

In the map I put only a trial substitution such as:
pippo+prova.html   pippo%20prova.html

The log gave me this report:

init rewrite engine with requested uri /default.ida
applying pattern '^/home/mhd/prova/www.domain.it/htdocs/(.*)' to uri
'/default.ida'
pass through /default.ida

What is my mistake ?

2. Exported directories don't appear on NT NFS client

3. mod_rewrite - ReWriteMap - Based on keywords

4. Solaris 2.6 4c/4m dead?

5. mod_rewrite and rewritemap efficiency

6. HP 820cxi printer and linux?

7. mod_rewrite RewriteMap lock error

8. Downloadinfg files : linux VS win95 .

9. mod_rewrite - ReWriteMap - Based on keywords

10. Solaris 2.6 Apache & Jserv & mod_rewrite question

11. &&&&----Looking for a unix shell------&&&&&

12. SSI and HTTP_USER_AGENT

13. ppp && PPPoE && ADSL && net && buffer(s)