Redirect All Traffic To One File With .htaccess
At some point, you may find you want to do something like put your website into maintenance, or temporarily offline. This can be accomplished in a few easy steps:
Create a .php or .html file that you will use to redirect all traffic to. We will call this temp.html. Now add the following into your .htaccess file at the top:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/temp\.html$
RewriteRule (.*) http://mydomain.com/temp.html [R=307,L]
Now all visitors to your site no matter what part of the site they try to access will land on the temp.html that you created.
