如何在iis 7.5中使Asp.net网站脱机

[英]How to take Asp.net website offline in iis 7.5


I have an ASP.NET website, but I would like to show an "under maintenance" page when my clients try to visit the site. Does anyone know how to do this?

我有一个ASP.NET网站,但是当我的客户试图访问该网站时,我想显示一个“维护不足”页面。有谁知道如何做到这一点?

1 个解决方案

#1


27  

If you are running your application within a .NET 4.0 application pool (IIS 7.0 or IIS 7.5) or your web site is configured as an ASP.NET 4.0 web site (IIS 6.0) and would like to show your clients an "under maintenance" page for a limited time, the easiest way is to put a file named app_offline.htm in your web site's root folder. Then your application will be taking offline and the clients will be served with app_offline.htm page whatever their requests are.

如果您在.NET 4.0应用程序池(IIS 7.0或IIS 7.5)中运行应用程序,或者您的网站配置为ASP.NET 4.0网站(IIS 6.0),并希望向您的客户显示“维护不足”在有限时间内的页面,最简单的方法是将名为app_offline.htm的文件放在网站的根文件夹中。然后您的应用程序将脱机,无论客户的请求是什么,客户都将通过app_offline.htm页面提供服务。

When you are done with maintenance, just remove or rename the file and everything goes back to normal.

完成维护后,只需删除或重命名文件,一切都恢复正常。

Source: Easiest way to take your web site offline (IIS 6.0 or IIS 7.5 with .NET 4.0)

来源:使您的网站脱机的最简单方法(使用.NET 4.0的IIS 6.0或IIS 7.5)


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2014/08/14/ab935cdb843cf6c4cebced739ef513e5.html



 
© 2014-2018 ITdaan.com 粤ICP备14056181号