Apache2 RewriteCond %{REQUEST_FILENAME} !-f not working

I was having an issue with my Apache2 config not matching files with:

RewriteCond %{REQUEST_FILENAME} !-f

I didn’t really get to the bottom of the problem, but I found that prefixing with the document root solved my issue:

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f

I have no idea why Apache wasn’t resolving %{REQUEST_FILENAME} relative to the project root, but I have a solution, so I have moved on.

Comments are closed.