400 Bad Request custom error page issue

Website URL

https://desmos-renderer.xo.je

Error Message

400 Bad Request

Other Information

I am facing some issues with the custom error page. The 400 Bad Request error page is not showing as I expect it to. I put my custom error pages through the dashboard in Error Pages section. But I get this:


It is not showing my custom error page. An error 400 shows a page like above instead.

Can you please share how exactly you’re triggering that 400 error page, and maybe tell us how we can see that for ourselves if possible?

Hey, sorry I was really busy.

About how I’m trying to trigger it is by doing this:

https://desmos-renderer.xo.je/%

Just putting that to trigger a bad request to test out if the custom page I set through Error Pages section of error 400 shows up or not. Instead of my custom 400 error page, I see the 400 bad request page in the picture above.

I see a custom 404 error on that page.

I said 400. Not 404. Because 404 works fine.

Update 1: Uh, that’s strange, but I tried to trigger it again and now it gets 404 page. Huh… I will update in a bit.

Update 2: Nevermind, it was just me. The https://desmos-renderer.xo.je/% trigger still works. Probably issues with my browser.

Try manually putting /% in the URL. Clicking the URL from here leads you to a new URL which is this: https://desmos-renderer.xo.je/%25

This URL shows you the error 404 page which already works.

OK, I see the issue now. The forum “fixes” the URL by encoding the percent sign, because otherwise the URL is invalid.

Your custom 400 page is indeed not working, but I don’t think that’s something we can fix. Our hosting uses two web servers: OpenResty at the outer layer doing most of the work, and Apache behind it to run PHP and process .htaccess rules.

When you send an invalid URL like /%, the server literally cannot parse the request. OpenResty rejects it at the outer layer because it can’t make sense of it, so the request never reaches Apache and your .htaccess rules never get applied. There’s a limit to how much control we can give you over requests that fundamentally can’t be processed.

Honestly, I’m not sure there’s a practical way to trigger a 400 that would reach Apache and show your custom page. A lot of the initial validation and checking is done by OpenResty and never reaches Apache.

I see. I guess there is nothing much that can be done here. Thank you very much for the help.