Why is AcceptPathInfo
applied when changing the filename, yet isn’t when I change the path? More concretely, I can get it to rewrite with:
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_FILENAME}:%{DOCUMENT_ROOT}%{REQUEST_URI} (.*):g1(.*)
RewriteRule ^ %{REQUEST_FILENAME}.php%2 [END]
And given that /aaa.php
exists, I get:
https://example.com/aaa/bbb/ccc -> https://example.com/aaa.php/bbb/ccc
Yet when I try it with:
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME}/index.php -f
RewriteCond %{REQUEST_FILENAME}:%{DOCUMENT_ROOT}%{REQUEST_URI} (.*):g1(.*)
RewriteRule ^ %{REQUEST_FILENAME}/index.php%2 [END]
And given that /aaa/index.php
exists, I get:
https://example.com/aaa/bbb/ccc -> 404 Not Found
I tried logging with LogLevel alert rewrite:trace6
, but all I saw is that RewriteCond %{REQUEST_FILENAME}.php -f
was checked for %{DOCUMENT_ROOT}/aaa.php
, as if it automatically tried all potential pathnames in case of %{REQUEST_FILENAME}.php
, but not %{REQUEST_FILENAME}/index.php
.
Is it possible to get this to work? That given /aaa/index.php
existing I would get:
https://example.com/aaa/bbb/ccc -> https://example.com/aaa/index.php/bbb/ccc
Just like the .php
rewrite above.