Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Custom Error Page shows 200 status


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


Level 10

See this KB:

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


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.