Forum Moderators: phranque
For instance:
Return a 403 for any hostname containing utexas.eduexcept for friendly.utexas.edu.
<or>
Return a 403 for 12.384.58.* but allow 12.384.58.93
..all while allowing every other non-listed subnet to haev uninterrupted access.
I believe I'll have to use mod_rewrite to do this, but I'm not entirely sure where to begin and would appreciate a general heads up of where to start, or some reading material that would be helpful for this specific situation.
As a simple example, the following code first blocks a large range, and then allows a smaller range and an additional single IP address in a different subnet of that range:
# Allow access by default, Deny specified IP addresses or ranges, Allows override Denies
Order Deny,Allow
#
# Deny from 192.168.0.0 to 192.168.255.255
Deny from 192.168
#
# Allow from 192.168.10.0 to 192.168.10.255
Allow from 192.168.10
#
# Allow from 192.168.123.321
Allow from 192.168.123.321
Note that only one Order directive can appear within a container (e.g. <FilesMatch> or <Directory>) that is not mutually-exclusive with other containers. If no containers are used, then only one Order directive per file can be used.
Jim