We've recently switched one of our web servers to apache 2.4 and running PHP via php-fpm and mod_proxy_fcgi. Most everything works quite well, but there is one problem that I don't understand yet. One of our sites is running WordPress, which brings along a good list of rewrite rules in its .htaccess file. And it seems that those don't work so well with the ProxyPass directive in the vhost setup.
Our vhost contains the following configuration:
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.2:9126/<path>/$1
This works in most cases.
Now, the htaccess file does, amongst other things, this:
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
As the site is a multiblog in subdirectories, I read that the URL /blogname/wp-admin/load-styles.php?xxxx should be rewritten as wp-admin/load-styles.php?xxx (the second rewrite rule). But looking at the mod_proxy log, the request that is passed actually is /blogname/wp-admin/load-styles.php.
I read this as there being a precedence problem – the ProxyPass rule fires before all of the RewriteRules have been worked off.
I'm stymied - what can be the cause?