Redirect all pages to one single page for maintenance with htaccess

If your website is down for maintenance or if you have problems with host provide you may want to redirect all requests to a single page.we could do this by adding some codes into .htaccess file which exist in root.

here is the code,just add in bottom of .htaccess file modify the URL to your desire:

RewriteEngine On
 RewriteBase /
 RewriteCond %{REQUEST_URI} !^/redirect\.html$
 RewriteRule ^(.*)$ [R=307,L]


Leave a Reply

Your email address will not be published. Required fields are marked *