Hi,
I can't find solution for this problem:
FIGURE A - work correctly as expected
script & folder structure:
.htaccess
index.php
sample.htm
.htaccess content:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^folder/([^/\.]+)\.htm$ index.php?url=$1 [DPI]
call url: /folder/test.htm
expected result: displaying content of index.php
result: correct
FIGURE B - and problem is here...
script & folder structure:
.htaccess
index.php
folder.htm
.htaccess content:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^folder/([^/\.]+)\.htm$ index.php?url=$1 [L,DPI]
call url: /folder/test.htm
expected result: displaying content of index.php
result: error - 404 not found file /folder.htm/test.htm
RewriteLog:
add path info postfix: /var/www/test.com/folder.htm -> /var/www/test.com/folder.htm/test.htm
strip per-dir prefix: /var/www/test.com/folder.htm/test.htm -> folder.htm/test.htm
So, in case of existing file (folder.htm) with same name as rewrited folder (/folder/) come this error.
Possible problems and solutions:
1) "add path info postfix" error - DPI flag tried (apache 2.2.14 & 2.2.21) - no change;
2) dir module conflict (directorySlash off, AcceptPathInfo off) - no change;
3) speling module conflict - disabled module - no change;
4) alias module conflict - no alias using (at all) - no change;
5) rewriteBase used - no change;
This looks like some kind logical conflict in apache config (on this my specific server) - another server, using apache 2.2.9 (with no DPI, "add path info postfix" error) work CORRECTLY with top example (without DPI flag in rewriteRule, of course). I'm not able to find this conflict, correct setting.
Any idea of solution?