Micky,
Oh, a "Website down for maintenance," eh? That's too simple!
I run (most of) my sites using PHP so index.php in the DirectoryIndex. That leaves index.html unused ... until I need to signify that I've taken a website offline. I leave the index.html there (as well as the index.php) but change the DirectoryIndex from
Code:
DirectoryIndex index.php index.html
to
Code:
DirectoryIndex index.html index.php
Now, that'll work for your DOMAIN but it will leave you to "play" with your website (as well as others that have links into the website).
The SERIOUS way to keep EVERYONE (yourself included) out of your website is to use mod_rewrite as follows:
Code:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^index\.html
RewriteRule .? index.html [R=302,L]
# R=302 is a temporary redirect
Of course, this will also KILL every image, stylesheet, script, etc. If you want to display everything BUT .php scripts, then change the RewriteRule to:
Code:
...
RewriteRule !\.php$ index.html [R=302,L]
If you still need access, add another RewriteCond like:
Code:
...
RewriteCond %{REMOTE_ADDR} !^{your IP address - escape the dot characters}$
...
Clear as mud?
Regards,
DK
Bookmarks