Here is my vhost file:
<VirtualHost *:80>
ServerName awesome.dev
## Vhost docroot
DocumentRoot "/var/www/awesome"
## Directories, there should at least be a declaration for /var/www/awesome
<Directory "/var/www/awesome">
Options Indexes FollowSymLinks MultiViews
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
## Logging
ErrorLog "/var/log/apache2/w0JhArMoDehc_error.log"
ServerSignature Off
CustomLog "/var/log/apache2/w0JhArMoDehc_access.log" combined
## Server aliases
ServerAlias www.awesome.dev
## SetEnv/SetEnvIf for environment variables
SetEnv APP_ENV dev
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/awesome/$1
</VirtualHost>
I'm trying to catch all requests for non-existing *.php files.
For example, if /var/www/awesome/index.php
exists and I go to http://foo.com/index.php I get the correct response, but if /var/www/awesome/foo.php
does not exist and I go to http://foo.com/foo.php, I am simply getting a response of File not found.
.
The .htaccess
file isn't being read because Apache hands everything off to PHP-FPM.
I need to catch all 404 requests and show a common error page, as you would normally see on any site.
However, since Apache hands everything off to php-fpm, it doesn't seem to be handling these errors properly.