Forum Moderators: phranque
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REMOTE_HOST} !^123\.45\.67\.89
RewriteCond %{REQUEST_URI} !/alternate_page\.html$
RewriteRule \.html$ /alternate_page.html [R=302,L]
Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{REMOTE_ADDR} !^123\.45\.67\.89$
RewriteCond %{REQUEST_URI} !/maintenance_page\.html$
RewriteRule \.html$ http://www.example.com/maintenance_page.html [R=302,L]
On yours, there is no way to tell but to test it -- both with a fake IP address in the first RewriteCond (to test the redirect case),
Order Deny,Allow
Deny from all
Allow from my.ip.add.res
You should re-consider "taking the site off-line for maintenance" as this simply should not be done, except for database re-formatting/re-indexing.
As kindly as possible, I advise you to note and correctly report all these little details, since you risk your site's correct operation and search rankings with even a simple oversight or a single typo...
Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{REMOTE_ADDR} !^123\.45\.67\.89$
RewriteCond %{REQUEST_URI} !/maintenance_page\.html$
RewriteRule \.(php|s?html?)$ http://www.example.com/maintenance_page.html [R=302,L]
Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{REMOTE_ADDR} !^123\.45\.67\.89$
RewriteCond %{REQUEST_URI} !/maintenance_page\.html$
RewriteRule ^([^/]*/)*(([^.]+\.)+(php|s?html?))?$ http://www.example.com/maintenance_page.html [R=302,L]