You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brad Nicholes <BN...@novell.com> on 2003/03/20 22:13:47 UTC

mod_rewrite is broken (was: Re: mod_rewrite on Netware)

After looking into this a little further, it appears that mod_rewrite is
broken in the 2.0 tree but fixed in 2.1.  The prefix_stat() function in
the  2.0 version expects the path to start with a '/' which is not only
false on NetWare but Windows and OS/2 as well.  Since a NetWare path
does not start with a '/', this function fails and causes mod_rewrite to
prepend the document root in error.  This has been fix in the 2.1
version and should probably be backported before 2.0.45 is tagged.  
Somebody who knows more about the changes that have been made recently
to mod_rewrite in the 2.1 tree should probably make the decision on what
should be back ported.

Brad

Brad Nicholes
Senior Software Engineer
Novell, Inc., the leading provider of Net business solutions
http://www.novell.com 

>>> Cliff Woolley <jw...@virginia.edu> Wednesday, March 19, 2003
12:17:32 PM >>>

Anybody happen to know if mod_rewrite is actually known to work on
Netware
right now?  One of my former colleagues is playing with it (on 2.0.44)
and
having some problems that smell of a file path canonicalization bug to
me.
See below.

Thanks...
Cliff

---------- Forwarded message ----------
Date: Wed, 19 Mar 2003 09:21:29 -0500
From: Jeff Knudson <JK...@wlu.edu>
To: jwoolley@virginia.edu 
Subject: mod_rewrite

I'm playing with mod_rewrite on Apache2 for NetWare and wanted to
bounce
a problem off of you.

Given the config:

<VirtualHost 137.113.100.171>
   ServerName AcadFsVhosts.wlu.edu
   DocumentRoot "HOME:/"
   <IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteLog logs/rewrite.log
      RewriteLogLevel 9
      RewriteRule ^(.+)                   %{HTTP_HOST}$1	[C]
      RewriteRule ^(.+)\.wlu\.edu\/*(.*)	$1/public_html/$2
   </IfModule>
</VirtualHost>


and the input "http://biology2.wlu.edu/index.html", do I get the URL
"biology2/public_html/index.html" without the DocumentRoot?


137.113.76.8 - - [19/Mar/2003:09:18:33 --0500]
[biology2.wlu.edu/sid#c99f05d8][rid#cc30d910/initial] (2) init rewrite
engine with requested uri /index.html
137.113.76.8 - - [19/Mar/2003:09:18:33 --0500]
[biology2.wlu.edu/sid#c99f05d8][rid#cc30d910/initial] (3) applying
pattern '^(.+)' to uri '/index.html'
137.113.76.8 - - [19/Mar/2003:09:18:33 --0500]
[biology2.wlu.edu/sid#c99f05d8][rid#cc30d910/initial] (2) rewrite
/index.html -> biology2.wlu.edu/index.html
137.113.76.8 - - [19/Mar/2003:09:18:33 --0500]
[biology2.wlu.edu/sid#c99f05d8][rid#cc30d910/initial] (3) applying
pattern '^(.+)\.wlu\.edu\/*(.*)' to uri 'biology2.wlu.edu/index.html'
137.113.76.8 - - [19/Mar/2003:09:18:33 --0500]
[biology2.wlu.edu/sid#c99f05d8][rid#cc30d910/initial] (2) rewrite
biology2.wlu.edu/index.html -> biology2/public_html/index.html
137.113.76.8 - - [19/Mar/2003:09:18:33 --0500]
[biology2.wlu.edu/sid#c99f05d8][rid#cc30d910/initial] (2) local path
result: biology2/public_html/index.html





If I change the last RewriteRule to:

      RewriteRule ^(.+)\.wlu\.edu\/*(.*)	HOME:/$1/public_html/$2

I get the URL "HOME:HOME:/biology2/public_html/index.html" with a Doc
Root????

Can you enlighten?
JK


137.113.76.8 - - [19/Mar/2003:09:22:01 --0500]
[biology2.wlu.edu/sid#c99efd98][rid#cc30d090/initial] (2) init rewrite
engine with requested uri /index.html
137.113.76.8 - - [19/Mar/2003:09:22:01 --0500]
[biology2.wlu.edu/sid#c99efd98][rid#cc30d090/initial] (3) applying
pattern '^(.+)' to uri '/index.html'
137.113.76.8 - - [19/Mar/2003:09:22:01 --0500]
[biology2.wlu.edu/sid#c99efd98][rid#cc30d090/initial] (2) rewrite
/index.html -> biology2.wlu.edu/index.html
137.113.76.8 - - [19/Mar/2003:09:22:01 --0500]
[biology2.wlu.edu/sid#c99efd98][rid#cc30d090/initial] (3) applying
pattern '^(.+)\.wlu\.edu\/*(.*)' to uri 'biology2.wlu.edu/index.html'
137.113.76.8 - - [19/Mar/2003:09:22:01 --0500]
[biology2.wlu.edu/sid#c99efd98][rid#cc30d090/initial] (2) rewrite
biology2.wlu.edu/index.html -> HOME:/biology2/public_html/index.html
137.113.76.8 - - [19/Mar/2003:09:22:01 --0500]
[biology2.wlu.edu/sid#c99efd98][rid#cc30d090/initial] (2) local path
result: HOME:/biology2/public_html/index.html
137.113.76.8 - - [19/Mar/2003:09:22:01 --0500]
[biology2.wlu.edu/sid#c99efd98][rid#cc30d090/initial] (2) prefixed
with
document_root to HOME:HOME:/biology2/public_html/index.html
137.113.76.8 - - [19/Mar/2003:09:22:01 --0500]
[biology2.wlu.edu/sid#c99efd98][rid#cc30d090/initial] (1) go-ahead
with
HOME:HOME:/biology2/public_html/index.html [OK]


  Jeff Knudson                   System Administrator
  University Computing           Email: jknudson@wlu.edu 
  Washington & Lee University    Phone: 540-458-8108
  Lexington, VA 24450            Fax: 540-458-8479



Re: mod_rewrite is broken

Posted by André Malo <nd...@perlig.de>.
* Brad Nicholes wrote:

> After looking into this a little further, it appears that mod_rewrite is
> broken in the 2.0 tree but fixed in 2.1.  The prefix_stat() function in
> the  2.0 version expects the path to start with a '/' which is not only
> false on NetWare but Windows and OS/2 as well.  Since a NetWare path
> does not start with a '/', this function fails and causes mod_rewrite to
> prepend the document root in error.  This has been fix in the 2.1
> version and should probably be backported before 2.0.45 is tagged.
> Somebody who knows more about the changes that have been made recently
> to mod_rewrite in the 2.1 tree should probably make the decision on what
> should be back ported.

ah yeah, it's already proposed (see status file), but it seems, the changes 
are too much for a short time review... ;-)

Btw: it's broken on every non-unix and it's not only prefix_stat (again, 
see status file for rev.#). I'd be very happy to get this into the current 
stables (1.3 too).

nd
-- 
Wenn nur Ingenieure mit Diplom programmieren würden, hätten wir
wahrscheinlich weniger schlechte Software.
Wir hätten allerdings auch weniger gute Software.
                                   -- Felix von Leitner in dasr