This is a continuation of my other post: Catch all VirtualHost not working.
I have got the catchall VirtualHost working. But know how do I get it to redirect a custom error page such as 404.
In my VirtualHost I add Redirect 404 /
, it takes me to the default 404 page. But when I enable ErrorDocument 404 /errors/index.php
I get the following error
Not Found
The requested URL / was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Below is my catchall config
<VirtualHost *:80>
DocumentRoot /var/www/main
ServerName null
Redirect 404 /
ErrorDocument 404 /errors/index.php
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>