Your message dated Mon, 08 Nov 2010 11:33:31 +0100
with message-id <f8a8e3d82ef05100229a380c54b95...@mail.fgv6.net>
and subject line Works for me now
has caused the Debian Bug report #503069,
regarding mod_rewrite bug with file-system path as substitution
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
503069: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=503069
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: apache2-mpm-worker
Version: 2.2.3-4+etch5
Severity: important

According to http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule <http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule> :

"The Substitution of a rewrite rule is the string that replaces the original URL-path that was matched by Pattern. The Substitution may be a:
[...]
*file-system path*
Designates the location on the file-system of the resource to be delivered to the client.
URL-path
A DocumentRoot-relative path to the resource to be served. *Note that mod_rewrite tries to guess whether you have specified a file-system path or a URL-path by checking to see if the first segment of the path exists at the root of the file-system.* For example, if you specify a Substitution string of /www/file.html, then this will be treated as a URL-path unless a directory named www exists at the root or your file-system, in which case it will be treated as a file-system path. If you wish other URL-mapping directives (such as Alias) to be applied to the resulting URL-path, use the [PT] flag as described below.
[...]"

TEST CASE:
1. In apache2.conf, add the following section
<FilesMatch "\.test$">
      Options FollowSymLinks
      RewriteEngine On
      RewriteRule ^(.*)$ $1.gz [L,PT]
</FilesMatch>
2. touch <DocumentRoot>/bar.test.gz
3. Access http://localhost/bar.test <http://localhost/foo>

ACTUAL RESULT:
You get an error page "The requested URL <DocumentRoot>/bar.test.gz was not found on this server.", because the substitution gets interpreted as URL relative to DocumentRoot For example, if the document root is "/var/www/example/" you'll find in the error log "File does not exist: /var/www/example/var"

EXPECTED:
The file <DocumentRoot>/bar.test.gz should be served.

A similar bug has already be filed on Ubuntu's bugtracking by someone else here : https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/174282 I guess it is related but the bug has been closed "because it lacks the information we need to investigate the problem".

By advance, thanks.

François.



--- End Message ---
--- Begin Message ---
Hi, 

Adding a "/" does the magic! 

But better : it works even without the "/" now! What happened? Has the bug
been silently fixed? Did I drink too much? Was it a special case that I
can't reproduce...

Anyway, works for me now...

Regards,

François.



--- End Message ---

Reply via email to