Skip to main content

When you perform maintenance on your web site, you may want to redirect all traffic to a maintenance page. It's quite simple in Apache. You add a rewrite rule to your site root .htaccess file.

# Place the following code in an `.htaccess` file in the root of
# your web directory.

RewriteEngine on
RewriteCond %{REQUEST_URI} !/maint/index.html$
RewriteRule $ /maint/index.html [R=302,L]

# Either place your maintenance file in `/maint/index.html`. Now ALL requests
# made to your site will be redirected to `/maint/index.html`.
#
# Remember to remove this rule after you have finished your site maintenance.