Redirecting with htaccess
January 3, 2007 9:33 AM
Subscribe
Taking a site offline with .htaccess. I have a server which is running in production, but I want to take it offline for some maintenance. While I want everyone who calls at any URL to be redirected to index.html, I want admins to be able to view the site in full.
I think something like this in .htaccess:
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !xxx.xxx.xxx.xxx
RewriteRule [regexp to rewrite anything.php to index.html]
where xxx.xxx.xxx.xxx is a permitted IP address should work, but it seems not to. Any help? Even if the solution only allows access from localhost (I can run lynx on the server) it'll do fine.
posted by fightorflight to computers & internet (6 comments total)
1 user marked this as a favorite
Personally I'd rename the directory and put up a temporary page in the relevant location, but that's just a kludge, obvy.
posted by loiseau at 9:36 AM on January 3, 2007