Allowing Access From 1 static IP and Deny the rest
Online CSS Compression Tools »
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 /home/user/askapache.com/.htpasswd AuthType basic Require valid-user Order deny,allow Deny from all Allow from 24.11.54.6 Satisfy Any
More information about this technique can be found in the htaccessElite.com Authentication Forum
Online CSS Compression Tools »
Please consider donating to support active development of the free software and articles here.![]()
The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect. Tim Berners-Lee
It's very simple - you read the protocol and write the code. -Bill Joy
HTML | DCMI | GRDDL | XOXO | XDMP | XFN | DOM | XML | XHTML 1.1 Strict | CSS 2.1 | W3C | TLDP | WAI | DISA | ICSI | GIAC | SANS RR | GHOST | DEFCON | NIST | DHS CYBER | NIST
↑ TOPExcept where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License, just credit with a link.
This site is not supported or endorsed by The Apache Software Foundation (ASF). All software and documentation produced by The ASF is licensed. "Apache" is a trademark of The ASF. HTTPD based on NCSA HTTPd
Hi, regarding the actual htaccess file, where would I save this file on my web server? Do I give the file the extension “
.htaccess“?Thank you
Pawel