Forum

Redirect every HTTP/HTTPS request to a maintenance site

Krawei
27 January 2017, 16:18
Hello Hugo, dear forum,

i would like to set up a basic html maintenance site with is being served to every HTTP/HTTPS request.

How can I set up this with hiawatha? I didn't found a topic like this in your HOWTO-section or FAQs so far.

Kind Regards,

Krawei
Hugo Leisink
27 January 2017, 16:29
What do you mean by 'basic html maintenance site'?
Erik S
27 January 2017, 16:30
perhaps Hiawatha as a reverse proxy?
Erik S
27 January 2017, 16:33
I am assuming you mean when a server is being maintained all requests to it are redirected to somewhere else during the maintenance period.
Krawei
27 January 2017, 17:11
Well I mean it like this:

We do some maintenance on some webservers in the future and we are planning to redirect every HTTP/HTTPS request (to the temporary "out-of-order-webservers") to the hiawatha server which hosts a simple maintenance website like "your web service is currently under construction, please try again later".

How do I set up this with your fast and nice little piece of software?
Krawei
27 January 2017, 17:13
In addition: I have the maintenance html file, all I need to know is how to set up the rewriting rules and where.
Hugo Leisink
27 January 2017, 19:21
What you could do is this:

Place all your virtual host configurations in a separate file in a subdir of your Hiawatha configuration directory. For example, I have a /etc/hiawatha/websites directory and in it a file hiawatha-webserver.org containing all websites for that domain. The same for banshee-php.org, etc. The last line of my hiawatha.conf file reads 'include websites'. Also place the 'default website' in a file in that directory.

Next, create a directory 'maintenance' inside the Hiawatha configuration directory. Make it contain a single file with only the default website configuration, which does what is needed to show the maintenance website.

If you want to switch to 'maintenance mode', simply change the 'include websites' to 'include maintenance'.

Is that what you are looking for?
This topic has been closed.