Httpd maintenance page

1.5k Views Asked by At

I am trying to create a maintenance page for our application.

The front server is

Server version: Apache/2.4.6 (Red Hat Enterprise Linux)

The maintenance page is under following directory:
/var/www/maintenance/index.html

I am configuring the ssl.conf file as below

# Redirect all request to a 503 return code when in maintenance mode
ErrorDocument 503 /maintenance/index.html
RewriteEngine on
RewriteCond /var/www/maintenance/ALL -f [OR]
RewriteCond /var/www/maintenance/%{SERVER_NAME} -f
RewriteCond %{REQUEST_URI} !=/maintenance/index.html
RewriteRule ^ - [R=503,L]

# Redirect away from the maintenance page if not in maintenance mode
RewriteCond  /apps/myApp/maintenance/ALL !-f
RewriteCond  /apps/myApp/maintenance/%{SERVER_NAME} !-f
RewriteRule ^/maintenance/index.html$ / [R,L]`

This seems like it's not working.

Does anyone have any idea?

1

There are 1 best solutions below

0
mister_cool_beans On

just add a temporary redirect to Apache configuration file to set into maintenance mode

Redirect / http://www.example.com/maintenance/index.html

to take out of maintenance mode just add hash symbol

# Redirect / http://www.example.com/maintenance/index.html