• GAWDS
  • Nik Makris is a Learning Tree .NET Enterprise Application Development Certified Professional
    .NET Enterprise Application Development
    Certified Professional
    Learning Tree International
  • Nik Makris is certified under the CCNA® program
    Nik Makris is certified under the CCNA® program
  • Nik Makris is Google Analytics Qualified
    Nik Makris has obtained the Google Analytics Individual Qualification
Blog

404 Error pages Returns code 200

10. November 2004 11:41

Since a site redesign we've been using a custom 404 ASP page rather than our old HTML 404 page, this gives us the opportunity to add dynamic content to the 404.asp page.

However after setting up Microsoft IIS to serve our custom 404.asp page we discovered to our dismay, using a HTTP header viewer, that the 404 page was returning a code '200 OK' rather than a '404 Not Found'.

After some searching the ASP Response.Status object was found. Now with just one line of code at the top of our ASP 404 page we can set the status to 404 Not Found!

Here's the code.

<%

Response.Status = "404 Not Found"

%>

I've added a link to a handy HTTP viewer below.

http://www.rexswain.com/httpview.html

Tags: ,

Filed under: Web Development | Web Servers

Comments are closed