Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 910
user3770612 Avatar asked Aug 14 '14 12:08

user3770612


People also ask

How to take a website offline IIS?

In a lot of scenarios, you'll want to take a web application offline while you make changes to related components, like databases or web services. Typically, in IIS and ASP.NET, you accomplish this by placing a file named App_offline. htm in the root folder of the IIS website or web application. The App_offline.

What does App_offline HTM do?

The App Offline file ( app_offline. htm ) is used by the ASP.NET Core Module to shut down an app. If a file with the name app_offline. htm is detected in the root directory of an app, the ASP.NET Core Module attempts to gracefully shut down the app and stop processing incoming requests.

How do I install ASP NET on Windows 10?

In Control Panel, click Programs, and then click Turn Windows features on or off. In the Windows Features dialog box, click Internet Information Services to install the default features. Expand the Application Development Features node and click ASP.NET 4.5 to add the features that support ASP.NET.


1 Answers

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.

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)

like image 134
Claudio Redi Avatar answered Sep 24 '22 04:09

Claudio Redi