I have Apache 2.0.49 compiled on HP-UX 11.00 and 11i with the HP C compiler. mod_rewrite doesn't seem to behave correctly. I added the following to httpd.conf: RewriteEngine on RewriteLogLevel 20 RewriteLog /tmp/rewrite.log
# Map images to be beautiful :-) RewriteRule ^/tww/img/(.*) http://www.tww.com/tww/img/$1 [P,L] RewriteRule ^/favicon.ico$ http://www.tww.com/favicon.ico [P,L] $ telnet impulse 80 HEAD /tww/img/tww.gif HTTP/1.0 $ cat /tmp/rewrite.log 192.168.1.38 - - [08/Jul/2004:09:17:15 --0500] [impulse.il.thewrittenword.com/sid#40015fa0][rid#400c7218/initial] (2) init rewrite engine with requested uri /tww/img/tww.gif 192.168.1.38 - - [08/Jul/2004:09:17:15 --0500] [impulse.il.thewrittenword.com/sid#40015fa0][rid#400c7218/initial] (3) applying pattern '^/tww/img/(.*)' to uri '/tww/img/tww.gif' 192.168.1.38 - - [08/Jul/2004:09:17:15 --0500] [impulse.il.thewrittenword.com/sid#40015fa0][rid#400c7218/initial] (3) applying pattern '^/favicon.ico$' to uri '/tww/img/tww.gif' 192.168.1.38 - - [08/Jul/2004:09:17:15 --0500] [impulse.il.thewrittenword.com/sid#40015fa0][rid#400c7218/initial] (1) pass through /tww/img/tww.gif This works fine on Solaris 9 and Redhat Linux 9. The rewrite for 'favicon.ico' does work. I think the problem is '(.*)'. I know that Apache is using the HP regcomp()/regexec() routines so I added some debugging to modules/mappers/mod_rewrite.c and the regexec() call is failing. I don't know why yet. I wrote the small program below to test regcomp()/regexec() on this RE and it works fine: #include <stdio.h> #include <regex.h> int main (void) { regex_t re; int ret; ret = regcomp (&re, "^/tww/img/(.*)", REG_EXTENDED); if (ret != 0) { puts ("a"); exit (1); } ret = regexec (&re, "/tww/img/tww.gif", 0, NULL, 0); if (ret != 0) { puts ("b"); exit (1); } } -- albert chin ([EMAIL PROTECTED])
