You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by fi...@sci.fi on 2010/11/28 20:21:40 UTC

[users@httpd] Path-rewritten file with path info served (mod_rewrite & AcceptPathInfo Off)

I have set AcceptPathInfo Off, yet I receive the file in question when it's served through
rewritten path using mod_rewrite, as if I had AcceptPathInfo On.
This doesn't seem to be the correct behavior, am I missing something?

(Using Apache 2.2.17 from Arch Linux repositories with shipped configuration,
only change was AllowOverride All.)


### Test case 1/2
GEThttp://localhost/testdir/txt-file/XYZ/
A direct request to the file is made with additional path info (/XYZ/).
Result: 404.

### Test case 2/2
Request the file matching RewriteCond with additional path info (/XYZ/). Rewrite rules below.
GEThttp://localhost/txt-file/XYZ/
Result: The file "txt-file" is served.


### .htaccess
RewriteEngine On
Rewritebase /
|AcceptPathInfo Off|

RewriteCond %{REQUEST_URI} !^/testdir
RewriteRule ^(.*)$ /testdir/$1


### File structure
[FILE] WWW-root/.htaccess
[DIR ] WWW-root/testdir/
[FILE] WWW-root/testdir/txt-file