Knowledge Base Navigation
KB Article: Denying access with .htaccess
|Article:||Denying access with .htaccess|
|Date Added:||04-27-2004 5:32:18|
Denying access with .htaccess
Every directory protected this way should have an index.html file that is given out when a request is made for a list of files in the directory. Without that file, a request for the directory will list all of the files in the directory.
Create a file named .htaccess within your directory (note the leading period). This file is consulted by the Web server to determine whether or not to allow access.
deny from all
allow from .domain.co.uk
allow from .domain.com
deny from 124.24.41
deny from 205.158.256.213
allow from all
In the case of the example .htaccess file (above) which restricts access to domain.co.uk and domain.com addresses, only hosts which have a valid domain name registered in the Domain Name System (DNS) will be allowed access. If you wish to also allow access to U-M hosts without a DNS entry, you can include the following lines in the .htaccess file (in addition to the existing lines in the example):
allow from 195.112
allow from 195.113
allow from 195.114
These additional lines must be after the order directive and before the tag.
Current rating: 8.68 by 99 users
|Please take one second and rate this article...
|Not a Chance||1||2||3||4||5||6||7||8||9||10||Absolutely|