I simply attempted to redirect nonexistent files around the server to my custom 404 page however it only redirects .html files.

I made use of that during my .htaccess file:

ErrorDocument 404 /404/404.html

How do i redirect all nonexistent files (including .php) to my custom page?


This will redirect all nonexistent files within the same directory as that .htaccess file. What goes on just in case a nonexistent PHP file is asked for?

Maybe another rule or directive (for instance, a redirect) processes the PHP files before it reaches your ErrorDocument directive. Without more details, this really is impossible to inform.

Try that:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteuRule .* home.html [L]

Should you wants 404 redirection RewriteuRule .* home.html [R=404,L]