What is the best way to update a webapp that's already up and running?

What I do now is:
Rename index.html and replace it with an index.html with a notification.
When ready, replace it back again.

However, I noticed that the temporary page is sometimes cached. So users still get to see the offline message while the webapp is up and running again.

I figured out that by adding these meta-tags, that shouldn't happen any more:

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
But there's another issue as well: Users come to the site by using certain parameters.
E.g.: https://this.ismysite.com/index.html...&param2=blabla

I noticed that even though the index.html is replaced, the website throws an ugly error when the Dataflex WebApp Server is stopped.

So I wonder:
What is the best way to update a site without throwing ugly errors to visitors?