PLEASE donate to the Free Software Foundation, the org that wrote the code for emacs, head, sed, tr, ncurses, emacs, parallel, bash, etc., - Their mission is to fight against proprietary software and hardware so that we the people are in control instead of publicly traded massive corporations. PLEASE, CLICK HERE.

Allowing Access From 1 static IP and Deny the rest

Say you want to deny access to your entire site except when you access it. The following htaccess code does just that. Instead of a Static IP you could also use a hostname, or part of a hostname..

AuthName "Site Administration"
AuthUserFile /web/user/
AuthType basic
Require valid-user
Order deny,allow
Deny from all
Allow from
Satisfy Any

More information about this technique can be found in the Authentication Forum

Specific posts:

  1. Order, Allow, Deny
  2. Block everyone except 1 IP Address
  3. Deny based on domain name
  4. Deny a Block of IP Addresses
  5. Deny A User based on their IP address
  6. Basic authentication example