Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Site is under construction" page for asp.net site

I have to implement ability to show "site is under construction" page during doing some maintenance work on site. There are a lot of ways to implement such behavior (using global.asax file, using IIS and so on). So I would like to know waht is the most used ways of impletenting this feature.

Thanks in advance.

like image 265
iburlakov Avatar asked Nov 15 '10 06:11

iburlakov


2 Answers

The change you're deploying now is a simple change to a single page. But sometimes you deploy larger changes, or you deploy both code and database changes, and the site might behave incorrectly if a user requests a page before deployment is finished. To prevent users from accessing the site while deployment is in progress, you can use an app_offline.htm file. When you put a file named app_offline.htm in the root folder of your application, IIS automatically displays that file instead of running your application. So to prevent access during deployment, you put app_offline.htm in the root folder, run the deployment process, and then remove app_offline.htm after successful deployment.

Source: https://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/deploying-a-code-update

like image 38
Ceylan B. Avatar answered Oct 27 '22 01:10

Ceylan B.


I prefer App_Offline.htm file in the root.

Take a scrape of your site template, stick it in the App_Offline.htm file and place a message in it. Just dropping this file in the root folder of your web site effectively disables your site.

Meanwhile, upload/manage a second instance of the web-site using a temporary domain/URL and when tested/ready, re-point the old site to the new site in IIS.

like image 106
Program.X Avatar answered Oct 26 '22 23:10

Program.X