How do I configure ASP.NET to show a custom error page, but still return the correct statusCode (i.e.404)?

Introducing the ONLY search engine optimization software product that has been 100% PROVEN to dramatically increase your rankings in Google, Yahoo, and Bing. Get it now!

Add this line in you web. Config file will do work.

Up vote 0 down vote favorite share g+ share fb share tw.

How can I configure ASP. NET/IIS to show custom error pages (i.e. A nice friendly error page), but to still return a 404/500 status code so that google does not try to index the page?

I have tried setting the Response. StatusCode to 404, but then the nice error page does not show anymore. Asp.net iis config link|improve this question edited Feb 9 at 15:34Pranay Rana28.9k32049 asked Jul 27 '10 at 12:29willem2,08711334 86% accept rate.

Accept ans if it works – Pranay Rana Feb 9 at 15:33.

Add this line in you web. Config file will do work mode="RemoteOnly" defaultRedirect="ErrorPage. Aspx" > customErrors Element (ASP.

NET Settings Schema).

Thanks pranay. Unfortunately the problem still remains. ASP.

NET sends a 302 responseCode, which lets the users browser redirect to the error page. I actually want a real 404 error code to be returned, but to still display the nice error page to the user. – willem Jul 27 '10 at 12:40 just change status code to 302 will work for you but I think you find out y its returning 302 – Pranay Rana Jul 27 '10 at 12:53.

I have not tried this yet, but this page describes the exact issue and how to solve it. ASP. NET's way of returning 302's for error pages is a known SEO "issue".

weblogs.asp.net/paxer/archive/2010/05/31....

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions