Have Apache show 404 at missing page URL instead of redirecting to error page URL

Apache server can be configured to show the error page at the error URL, or it can redirect to the error page. It is almost better to show the error page directly at the URL rather than redirecting to it.

The Apache ErrorDocument directive explains how to implement it both ways:

URLs can begin with a slash (/) for local web-paths (relative to the DocumentRoot), or be a full URL which the client can resolve.

In practical terms, that means if you specify the error document as an absolute URL it will cause a redirect to the error page:

ErrorDocument 404 http://www.example.com/404.html

but if you specify the error document as a relative URL starting with a slash, it will show the error document at the original URL where the error occurred:

ErrorDocument 404 /404.html

My guess is that you have your ErrorDocument directive configured as an absolute URL either in your .htaccess file or your httpd.conf file. You need to edit it to change it to a relative URL.