https://issues.apache.org/bugzilla/show_bug.cgi?id=53929
Priority: P2
Bug ID: 53929
Assignee: [email protected]
Summary: RewriteRule of "^$" broke between 2.2.21 and 2.4.2
Severity: normal
Classification: Unclassified
Reporter: [email protected]
Hardware: PC
Status: NEW
Version: 2.4.2
Component: mod_rewrite
Product: Apache httpd-2
The following .htaccess configuration worked fine in 2.2.21:
RewriteCond %{DOCUMENT_ROOT}/index-cached.html -f
RewriteRule ^$ /index-cached.html [L]
RewriteCond %{DOCUMENT_ROOT}/$1-cached.html -f
RewriteRule ^([^/]+?)/$ /$1-cached.html [L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /index.php [L]
where browsing to "http://test.local" returns the contents of index-cached.html
correctly.
However, in 2.4.2, processing falls through to index.php, even though the logs
seem to indicate that the first condition was matched:
[rid#13ad0b0/initial] [perdir C:/test/] strip per-dir prefix: C:/test/ ->
[rid#13ad0b0/initial] [perdir C:/test/] applying pattern '^$' to uri ''
[rid#13ad0b0/initial] [perdir C:/test/] RewriteCond:
input='C:/test/index-cached.html' pattern='-f' => matched
[rid#13ad0b0/initial] [perdir C:/test/] rewrite '' -> '/index-cached.html'
[rid#13ad0b0/initial] [perdir C:/test/] trying to replace prefix C:/test/
with /
[rid#13ad0b0/initial] [perdir C:/test/] internal redirect with
/index-cached.html [INTERNAL REDIRECT]
[rid#13b30c8/subreq] [perdir C:/test/] strip per-dir prefix:
C:/test/index.php -> index.php
[rid#13b30c8/subreq] [perdir C:/test/] applying pattern '^$' to uri
'index.php'
[rid#13b30c8/subreq] [perdir C:/test/] strip per-dir prefix:
C:/test/index.php -> index.php
[rid#13b30c8/subreq] [perdir C:/test/] applying pattern '^([^/]+?)/$' to uri
'index.php'
[rid#13b30c8/subreq] [perdir C:/test/] strip per-dir prefix:
C:/test/index.php -> index.php
[rid#13b30c8/subreq] [perdir C:/test/] applying pattern '^index\\.php$' to
uri 'index.php'
[rid#13b30c8/subreq] [perdir C:/test/] pass through C:/test/index.php
Notice that after the "initial" request finishes, a "subreq" is generated,
whereas "initial/redir#1" was expected.
Both of my 2.2.21 and 2.4.2 environments have mod_dir enabled, which may or may
not have bearing on this issue.
Note also that the second rule works in both versions; that is, browsing to
"http://test.local/a/" correctly returns the contents of a-cached.html.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]