Soldato
- Joined
- 2 Jun 2004
- Posts
- 18,423
I want to close my site to everyone except myself while I work on it. How do I do this?
Order Deny,Allow
Allow From YOUR_IP_ADDRESS
Deny From All
AuthUserFile /path/to/password/file/.htpasswd
AuthName "Some text to be shown in the password box"
AuthType Basic
require user USER_NAME
USER_NAME:PASSWORD
htpasswd -cb /path/to/file/.htpasswd USER_NAME PASSWORD
The problem is that what I'm setting up has way too many settings which are set by the location you install it too, so moving it would be a pain, as most of it would stop working. So ideally it would be a lot easier to install it exactly where I want it to be. So I think htaccess is the only way to do this.not sure how to with htaccess and a quick google doesn't say either, but one method could be to stick everything in one folder down, named anything, and put a temp index file in root folder saying under construction, then when done move everything back out of the folder back to root folder.
RewriteEngine on
RewriteCond %{REMOTE_HOST} !^YOUR_IP_ADDRESS
RewriteRule ^.*$ redirection_target.html [R=302,L]
ErrorDocument 403 error_page.html
If I use the IP deny thing, can I also make it redirect people to somewhere else, so that I can explain why the site is not available?
order deny,allow
deny from all
allow from xx.xx.xx.xx