You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Albert Chin <ap...@mlists.thewrittenword.com> on 2004/07/08 16:23:00 UTC
mod_rewrite failing for 2.0.49 on HP-UX 11.x
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 (china@thewrittenword.com)
Re: mod_rewrite failing for 2.0.49 on HP-UX 11.x
Posted by Albert Chin <ap...@mlists.thewrittenword.com>.
On Thu, Jul 08, 2004 at 03:28:08PM +0100, Joe Orton wrote:
> On Thu, Jul 08, 2004 at 09:23:00AM -0500, Albert Chin wrote:
> > 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:
>
> If the C library regcomp()/regexec() are really being used from
> mod_rewrite rather than the PCRE implementations, that's probably the
> issue, e.g. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26088 and
> friends.
Thanks. That is the problem. We're going to force linkage of pcre
early to resolve the problem.
--
albert chin (china@thewrittenword.com)
Re: mod_rewrite failing for 2.0.49 on HP-UX 11.x
Posted by Joe Orton <jo...@redhat.com>.
On Thu, Jul 08, 2004 at 09:23:00AM -0500, Albert Chin wrote:
> 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:
If the C library regcomp()/regexec() are really being used from
mod_rewrite rather than the PCRE implementations, that's probably the
issue, e.g. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26088 and
friends.
joe