https://httpd.apache.org/docs/2.4/mod/core.html#er...Note that when you specify an ErrorDocument that points to a remote URL (ie. anything with a method such as http in front of it), Apache HTTP Server will send a redirect to the client to tell it where to find the document, even if the document ends up being on the same server. This has several implications, the most important being that the client will not receive the original error status code, but instead will receive a redirect status code.
Всё что начинается на http:// https:// трактуется как внешний ресурс, даже если там ссылка на тот же самый домен.
Редирект происходит из-за указания схемы и хоста.
ErrorDocument 404 /404.php