App_offline.htm and 404: why?

F

fhtino

App_offline.htm is a very usefull feature during web site updates. But
I don't understand why asp.net engine returns a 404 status code instead
of a "normal" 200.

I created a simple app_offline file:
<html>
<body>
Apllication off line!
</body>
</html>

I put it in the root of my web site. Now for every request IIS returns:

HTTP/1.1 404 Not Found
Server: Microsoft-IIS/5.1
Date: Thu, 09 Feb 2006 07:58:00 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: text/html
Content-Length: 57

<html>
<body>
Apllication off line!
</body>
</html>


I don't understand why "HTTP/1.1 404 Not Found".
I think the right response should be "HTTP/1.1 200 OK"....



Thank you


Fabrizio
 
J

Juan T. Llibre

Fabrizio,

what is not being found is the your App's document.

You didn't request "App_offline.htm".

You requested your app's default document or some other document in your app.

That call is intercepted; the 404 is returned for whichever page was requested,
and then App_offline.htm is displayed, but the 404 refers to the original page requested.




Juan T. Llibre
ASP.NET MVP
ASPNETFAQ.COM : http://www.aspnetfaq.com
==================================
 
F

fhtino

OK. I have understood that. But I think it's not a good implementation.

Infact InternetExplorer does not show the my app_offline page content
but a generic friendly message associated with the 404 status code
(oh, I know I can disable the friendly messages but they are active by
default on all IE).

For info: Firefox display the content.... good but 80 / 90 % of users
use IE.


Fabrizio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top