Alternative app_offline

I usually place app_offline.htm in my root directory when I release a website into a production environment. However, sometimes, if there were several big changes on the site, I would like to click first to make sure that it is stable, not allowing access to anyone else but me.

As far as I know, this is not possible, but I hope someone has a neat solution ...

The solution should include if someone has a deeplink to the site, so using the default.htm / asp page in the root will not do the trick, unfortunately.

+7
source share
3 answers

I agree with the middleware answer above, but otherwise there is one possible approach: temporarily block all IP addresses except your own. This can be achieved using the IIS Directory security configuration or programmatically in any number of ways.

You can redirect all unauthorized users to any Under Construction page. In the meantime, you can happily browse the site from your IP address. When the site is verified, you remove this IP restriction and the site becomes accessible to the whole world.

+4
source

This is a difficult task. This is why you should have an intermediate environment in which everything needs to be checked before being sent to production. Then, during the deployment process (if it takes a lot of time, but it shouldn’t), you can use the App_Offline file. This intermediate environment should be as close as possible to your production environment (in terms of software, patches, and configurations that are installed, of course, not in terms of hardware power).

+1
source

Another quick suggestion that allows you to control things from web.config can include a custom module that redirects all requests to a static page, except for those defined by the filter (for example, hostname, URL) that can be configured via web.config.

+1
source

All Articles