htaccess - block all during site update
Posted: Thu Sep 03, 2009 4:21 pm
Hello,
I need to update some core files on my site and need to redirect all requests to my site with the exception of my IP address to a temporary index file (index.html) located at the root.
I tried to get help through my web host but can't seem to get a straight answer.
Here is what I have figured out so far, but as you can guess, my IP is redirected as well.
(This is just part of the .htaccess file)
RewriteCond %{HTTP_HOST} ^SITENAME.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.SITENAME.com$
RewriteRule ^index\.php\/?(.*)$ "http\:\/\/SITENAME\.com\/index\.html" [R=302,L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^DIRECTORY1\/?(.*)$ "http\:\/\/SITENAME\.com\/index\.html" [R=302,L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^DIRECTORY2\/?(.*)$ "http\:\/\/SITENAME\.com\/index\.html" [R=302,L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^DIRECTORY3\/?(.*)$ "http\:\/\/SITENAME\.com\/index\.html" [R=302,L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^DIRECTORY4\/?(.*)$ "http\:\/\/SITENAME\.com\/index\.html" [R=302,L]
Is there a way or code that I can insert into the .htaccess file that will allow just my IP address, so I can test for errors?
Thanks!
Wayne
I need to update some core files on my site and need to redirect all requests to my site with the exception of my IP address to a temporary index file (index.html) located at the root.
I tried to get help through my web host but can't seem to get a straight answer.
Here is what I have figured out so far, but as you can guess, my IP is redirected as well.
(This is just part of the .htaccess file)
RewriteCond %{HTTP_HOST} ^SITENAME.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.SITENAME.com$
RewriteRule ^index\.php\/?(.*)$ "http\:\/\/SITENAME\.com\/index\.html" [R=302,L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^DIRECTORY1\/?(.*)$ "http\:\/\/SITENAME\.com\/index\.html" [R=302,L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^DIRECTORY2\/?(.*)$ "http\:\/\/SITENAME\.com\/index\.html" [R=302,L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^DIRECTORY3\/?(.*)$ "http\:\/\/SITENAME\.com\/index\.html" [R=302,L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^DIRECTORY4\/?(.*)$ "http\:\/\/SITENAME\.com\/index\.html" [R=302,L]
Is there a way or code that I can insert into the .htaccess file that will allow just my IP address, so I can test for errors?
Thanks!
Wayne