The headers sent by PHP in this case are only relevant to the browser. Apache is not going to create its own page, because you are already processing the page, and if you send something, they conflict.
Yes, the .htaccess file will prevent Apache from showing the error page because your rules cause Apache to no longer have the 404 error because it has detected that the page is being displayed.
Sending a header is actually just a "status message" and does not make the browser or server display a specific page. (Although most browsers will be).
As Dove noted in the comments, you'll want to send 404 errors to your own error page.
Tyler carter
source share