If you need to take your website offline, for any reason (eg. database maintenance, site move etc), you can do so very easily by just creating one .htm file and dropping in the root folder of your website. Here’s what you need to do:
How to create a asp.net maintenance notice
- Create a blank HTML file called ‘app_offline.htm’, without the quotes.
- Open the file in your chosen editor (eg. Visual Studio, Notepad++, Dreamweaver etc).
- The ‘app_offline.htm’ file must be structured as a valid HTML format, like the below example.
<html> <head> <title>Website name</title> </head> <body> <div style="text-align:center;"> This website is currently offline for maintenance. Please try again later. </div> </body> </html>
- Make sure you change the contents of the title tag as well as changing the message.
How to activate the asp.net maintenance notice
To activate the asp.net maintenance notice that you created using the above steps, simply upload it to the root folder of your website.
If the maintenance message does not show, you may need to restart your sites application pool.
How to deactivate the asp.net maintenance notice
To de-activate the asp.net maintenance notice, simply deleted the ‘app_offline.htm’ file from the root folder of your website.