I'm trying to setup some customer error pages on our Apache servers, which seemed straightforward. The 503 is working right, but the 404 is not. They're setup the same:
<LocationMatch "/my/uri">
ErrorDocument 503 /errorCustom.html
ErrorDocument 404 /errorCustom.html
</LocationMatch>
But when I hit a bad URL in the site, the Apache log clearly says it triggered a 404 as expected:
123.123.123.123 [22/Nov/2021:10:15:17 -0500] "GET /my/uri/%2f%20%20has%20moved.%20Please%20go%20to%20www.garbage.com/.%20The%20requested%20URL HTTP/1.1" 404 273 201 my-masked.hostname.com (-) "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36"
But the browser doesn't display the custom error html page ... browser just tells me this ...
Not Found
The requested URL /my/uri// has moved.
Please go to www.garbage.com/.
The requested URL was not found on this server
So I think the "moved" part is important in the message, but I can't figure out how to correct it and make the 404 ErrorDocument get triggered. What am I doing wrong here ?