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
htaccess - block all during site update
Moderator: General Moderators
-
gwnterprises
- Forum Newbie
- Posts: 5
- Joined: Sun Jul 26, 2009 1:30 pm
Re: htaccess - block all during site update
Code: Select all
RewriteCond %REMOTE_ADDR !^127.0.0.1$
RewriteRule ^(.*)$ http://yourdomain.com/tempfilename.html [R=302,L]-
gwnterprises
- Forum Newbie
- Posts: 5
- Joined: Sun Jul 26, 2009 1:30 pm
Re: htaccess - block all during site update
Thanks Darhazer,
I try to find the answer on my own, a great way to learn.
I'll try to find a site/book/etc... for this type of language.
When all fails,this forum is a good place to get great help.
Thanks again
Wayne
I try to find the answer on my own, a great way to learn.
I'll try to find a site/book/etc... for this type of language.
When all fails,this forum is a good place to get great help.
Thanks again
Wayne