SEARCH MARKETING BLOG

Sorting 404 on IIS in ASP

Argh. How frustrating are error pages on IIS?

Very frustrating.

Indeed.

Spent ages faffing about switching custom error handling on in Plesk and creating the customer error file and uploading and then tested the stupid page using an http header status check page and what status do you think was returned.

HTTP/1.1 200 OK

Rant, rant, rant.

But the day was saved by remembering the header status can be set using a bit of script. For all other users suffering the same pain, stick this snippet at the top of your error ASP page:

<%
Response.Status = “404 Not Found”
%>

and hey presto – HTTP/1.1 404 Not Found

Yay. Cup of coffee. What fun Search Engine Optimisation is