Expand my Community achievements bar.

Custom Error Page shows 200 status

Avatar

Level 4

I have a custom error logic written in 404.jsp. In this file I have wrote a response.sendRedirect(< My Custom Error Page>);

When landing on the customized error page, the response status is 200. I have a separate template for my 404 page. I tried to set <% response.setStatus(404);%> in the content.jsp of that template but still the response status is 200.

I need this customized error page to return a 404 status.

Thanks in advance !!

2 Replies

Avatar

Level 10

See this KB:

https://helpx.adobe.com/experience-manager/kb/CustomErrorHandling.html

It talks about how to create custom scripts or error handlers that render different HTTP errors .

Avatar

Level 4

Hi Scott,

I already overlayed /apps/sling/servlet/errorhandler and also the I turned off CQ WCM Debug Filter. I believe because of response.sendRedirect("/404page.html"), it is throwing status as 200. I am trying to throw status as 404 even If I am doing a redirect to my custom page.

As mentioned above I tried to reset the status too on my custom error page "404page.html" but it didn't work.