httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53929] New: RewriteRule of "^$" broke between 2.2.21 and 2.4.2
Date Mon, 24 Sep 2012 09:03:43 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53929

          Priority: P2
            Bug ID: 53929
          Assignee: bugs@httpd.apache.org
           Summary: RewriteRule of "^$" broke between 2.2.21 and 2.4.2
          Severity: normal
    Classification: Unclassified
          Reporter: victor.shih@gmail.com
          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: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message