Resources: Linux and Apache

Htaccess temporary redirect while undergoing maintenance

4 October 2012

Developing a site and you want to have a nice temporary page for visitors? Drop in this code at the top of your .htaccess file and make your pretty 'Coming Soon' page in the root called 'offline.html'.

RewriteEngine on
RewriteCond %{HTTP_HOST} example\.co\.nz [NC]
RewriteCond %{REQUEST_URI} ^/$
Rewriterule ^(.*)$ [L,R=302]

Tags: , , ,

Let's work together