If you want to redirect whenever the 'index2.html' file is present, for example while performing maintenance on your site, then you could use a rewrite rule like this (put it in your apache config file):
Code:
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/index2.html -f
RewriteRule ^/index.html$ /index2.html [R]
What these lines do is:
1. Enable the rewrite engine
2. Determine if index2.html exists in the document root (usually /var/www/html), if it does exist, then process the rewrite rules below
3. Rewrite requests for /index.html to /index2.html, and the R bit at the end says to do this using a redirect
Bookmarks