I have a asp.net website that has other ‘child’ asp.net applications within that are setup as separate IIS applications, while others are not child applications.
What would be a good way to prevent users from accessing the website during deployments/updates/downtime.
I know I could do this using the web.config, but that would mean me having to update multiple web.config’s manually during site lock downs.
I could also have each request hit the database, but that seems a little much for this.
Suggestions?
I don’t have direct access to the servers so I can’t fiddle with IIS.
You can put IIS in maintenance mode simply by putting a
app_offline.htmfile in your website’s root directory.Once IIS sees this, all traffic is directed to this page. There are some severe limitations to what this .htm file can contains though.
The offline file cannot contain references to other files, so styles and the like need to be embedded within to work.
As an added bonus, although most people believe you can’t add images(because you can’t access other files from this offline file) in this offline file, you technically still can by converting the image to base64 encoding and creating an html image tag to render it. That works for IE 8+ I believe, as well as chrome, FF and safari.