Score:0

Apache log says "404" but my ErrorDocument is ignored and browser says "The requested URL ... has moved"

kz flag

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 ?

cn flag
Bob
There may be other configuration settings in effect that take precedence. Check for example the httpd.conf, any included virtualhost directives and/or for the presence of a .htaccess file
Tilman Schmidt avatar
bd flag
The log entry looks strange. Did you really enter `http://my-masked.hostname.com/my/uri/%2f%20%20has%20moved.%20Please%20go%20to%20www.garbage.com/.%20The%20requested%20URL` as URL in your browser?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.