We are currently trying to switch our web server to apache 2.4 running with PHP via php-fpm and mod_proxy_fcgi in Docker environment.
We used to have URL rewrite rule as follows in Apache config and it worked well with previous "mod_php" setup:
RewriteRule ^/test$ /test.php [QSA
]
However, once we switch to Apache 2.4 + PHP-FPM with following setup in Apache config, the php stops working for this URL (/test):
RewriteEngine On
RewriteRule ^/test$ /test.php [QSA]
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://php:9000/var/www/html/$1
With this setting, the URL http:///test leads to a plain text on the screen showing the content of "test.php", which means the page was not being fed into PHP at all; however, if I change the rewrite rule flag from "QSA" to "R", PHP starts to work and everything is fine.
It seems "ProxyPassMatch" line is executed before RewriteRule when "R" is not there. So if that is the case, does anybody have solution to this problem? I'm sure there are a lot of web sites using clean URLs, which usually don't have "php" extension, for PHP pages...
Thanks in advance.