What’s the easiest way to create a temporary “maintenance page” for my site?

answered
#1

You need to take your site offline for maintenance, and Netlify enables a great workflow for this! We suggest using a either a manual deploy or a special maintenance branch in your repository so you don’t have to do any heavy lifts like remove all files from your normal production branch in case you use our continuous deployment system.

To use either of those paths, you’ll start by creating some static html that displays your maintenance message. You can of course use graphics and other asset types, but you don't need more than this: <html>Our site is down for maintenance</html> in a single index.html file deployed at the root of your site. Note that this will temporarily REMOVE FROM SERVICE all the REST of the files, and redirects on your normal deploy until you later re-publish a production deploy again, so if you have mission critical things like a manifest, or redirects that should still be active despite maintenance, you must include them with this deploy! You might want to put a catch-all redirect in place too, something like /* /index.html 302 that will make all pages show the maintenance message.

To deploy manually:

  1. put all of that content into a folder, let’s call it maintenance
  2. drag that folder to your deploy listings on the site you want to put under maintenance. This will publish the maintenance page as a new deploy.
  3. after previewing the content, use the button to publish this deploy (from its deploy logs page.)

To deploy via git:

  1. instead create a branch called e.g. maintenance with the content you wish to have live in it.
  2. update your Build & Deploy settings to also build this maintenance branch. You can add it to the list of allowed branches if you don’t already allow all branches to be built.
  3. next, successfully deploy this branch (it will be a Branch Deploy)
  4. after previewing the content, use the button to publish this deploy (from its deploy logs page.)

Following up from either method:

  1. when maintenance is done, click into the previous production deploy from your deploys listing, and choose to publish it again with the button there. No need to change code - you just choose the old deploy to republish by selecting the deploy, and on its logs page, use the “publish deploy” button to roll back to this deploy.
  2. future deploys via your normal channel (whether that is git commits, CLI, API, or drag and drop) will work as usual going forward.
3 Likes
#2

One of the easiest “maintenance” workflows ever!

2 Likes