httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Haase-Thomas <>
Subject Re: mod_rewrite not substituting properly
Date Wed, 16 Jan 2002 07:33:48 GMT

I'm not sure whether I'll really hit your problem, but maybe, I had 
similar problems with the two versions of apache you mentioned.
What I found out is that in 1.3.22 at least one Apache global has 
changed its content, namely %{REQUEST_FILENAME}.

Request: GET
%{REQUEST_FILENAME} in 1.3.14: 'blah.html' - in 1.3.22 '/baz/blah.html'.

Furthermore mod_rewrite hav real problems with unary operators, as '-s' 
or '-f'. This seems being a bug to me, as I've been quarreling two days 
with that handful of chars.

Hope this is helpful

Hugh Williams wrote:

>My Apache migration has proven troublesome.  Went from
> HP-UX 11.00 running Apache 1.3.14
> HP-UX 11.11 running Apache 1.3.22
>and now mod_rewrite appears to behave differently.  The problem I have
>been solving on both old and new platforms is
>  old web site had path /cgi-bin/public/...
>  new web site has path /cgi-bin/org/...
>all else in downstream path(s) identical
>So, I'm trying to rewrite that URI.  No virtual hosts; inside httpd.conf:
>DocumentRoot /opt/apache/htdocs
>    RewriteEngine   on
>    RewriteLog      /opt/apache/logs/rewrite_log
>    RewriteLogLevel 4
>    RewriteRule     ^/cgi-bin/public/atm/(.*)  /cgi-bin/org/atm/$1   [PT]
>rewrite_log says:
> - - [15/Jan/2002:17:29:12 -0800] [][rid#400ef738/initial]
(2) init rewrite engine with requested uri /cgi-bin/public/atm/
> - - [15/Jan/2002:17:29:12 -0800] [][rid#400ef738/initial]
(3) applying pattern '^/cgi-bin/public/atm/(.*)' to uri '/cgi-bin/public/atm/'
> - - [15/Jan/2002:17:29:12 -0800] [][rid#400ef738/initial]
(2) rewrite /cgi-bin/public/atm/ -> /cgi-bin/org/atm//cgi-bin/public/atm/
> - - [15/Jan/2002:17:29:12 -0800] [][rid#400ef738/initial]
(2) forcing '/cgi-bin/org/atm//cgi-bin/public/atm/' to get passed through to
next API URI-to-filename handler
>Can anyone shed light on why the rewrite is apparently appending the
>entire search pattern, and not just the captured back-reference piece of
>the search pattern?  I've tried:
> flags PT, R, and L in various configurations
> ^/cgi-bin/public/atm(.*) /cgi-bin/org/atm$1
>     just like the documented example in 
> ^/cgi-bin/public/(.*) /cgi-bin/org/$1
>All have similar results.  This worked on the older OS/Apache
>combination, and I can still get it to work on other older servers.  I
>can also get rewrites to work in the new environment if I 'hard-code'
>the rewrite; this works just great:
>RewriteRule /cgi-bin/public/atm/ /cgi-bin/org/atm/ [R]
>But having to have a rewrite line for each file is not pretty :-(

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message