如何确定app_offline.htm是否发出404或503错误

时间:2022-04-22 05:38:49

I have set app_offline.htm to my root directory and it works nicely to shut the site down and only show that page. Knowing for some frameworks (ASP.Net 2), this file will yield error 404 instead of 503, I want to check what code does my site return (for SEO purpose). However, when I enter a file url, instead of return me any error, it always goes back/redirects to the app_offline page automatically. How could I check to see my app pool is returning 404 or 503 now?

我已经将app_offline.htm设置为我的根目录,它可以很好地关闭网站,只显示该页面。知道一些框架(ASP.Net 2),这个文件将产生错误404而不是503,我想检查我的网站返回什么代码(用于SEO目的)。但是,当我输入文件网址时,它不会返回任何错误,而是会自动返回/重定向到app_offline页面。我怎么能检查我的应用程序池现在返回404或503?

P.S. I heard ASP.NET 4 (the one I use) is now always return 503. But I just want to double make sure.

附:我听说ASP.NET 4(我使用的那个)现在总是返回503.但我只想双倍确认。

Thanks!

谢谢!

1 个解决方案

#1


1  

You could use Internet Explorer together with the ieHTTPHeaders add-in.

您可以将Internet Explorer与ieHTTPHeaders加载项一起使用。

By using this add-in you see the detailed headers being sent and received in your browser.

通过使用此加载项,您可以在浏览器中看到要发送和接收的详细标题。

E.g. the following is an excerpt when navigating to Stack Overflow:

例如。以下是导航到Stack Overflow时的摘录:

如何确定app_offline.htm是否发出404或503错误

As you can see the first request (in black font) is being answered (in blue font) with a status code of 200.

如您所见,第一个请求(黑色字体)正在被回答(蓝色字体),状态代码为200。

So in your case, simply open the ieHTTPHeaders add-in and then navigate to your app_offline.htm website.

因此,在您的情况下,只需打开ieHTTPHeaders加载项,然后导航到您的app_offline.htm网站。

#1


1  

You could use Internet Explorer together with the ieHTTPHeaders add-in.

您可以将Internet Explorer与ieHTTPHeaders加载项一起使用。

By using this add-in you see the detailed headers being sent and received in your browser.

通过使用此加载项,您可以在浏览器中看到要发送和接收的详细标题。

E.g. the following is an excerpt when navigating to Stack Overflow:

例如。以下是导航到Stack Overflow时的摘录:

如何确定app_offline.htm是否发出404或503错误

As you can see the first request (in black font) is being answered (in blue font) with a status code of 200.

如您所见,第一个请求(黑色字体)正在被回答(蓝色字体),状态代码为200。

So in your case, simply open the ieHTTPHeaders add-in and then navigate to your app_offline.htm website.

因此,在您的情况下,只需打开ieHTTPHeaders加载项,然后导航到您的app_offline.htm网站。