Hi @gaia-jyh, I"m just curious, because REST is used for populating a client with data e.g. as application/json… how would that 404 custom page be consumed by the requesting client? Sending such a custom page doesn’t make much sense in REST. I wouldn’t send any payload at all for a 404 status code. Showing the api list is something that should be done by your api documentation.
This all happens in the RestServlet, so doesn’t look like you can catch it with any Application.cfc method. I see it all happens at:
One option would be to change that text and rebuilt the Lucee.jar. Maybe someone else can tell a better solution how to intercept this error. But if nothing else works, that would be the way I’d go.