Forum Moderators: phranque
<Files *>
Order Deny,Allow
Deny from ^###\.##\.###\.##$
As to which is "better," that's largely a matter of preference or necessity; Some servers don't support mod_rewrite, so the only way to block access is with mod_access (or a script). Other subtle differences may also be important in the decision too; In some server configurations, mod_access-denied accesses are logged to the server error log, while mod_rewrite-denied accesses are logged to the server access log.
Jim
For example, you could use
Deny from 123.45.67.
to block addresses in the range 123.45.67.0 through 123.45.67.255
Or you could use
Deny from 123.45.67.0/255.255.255.0
Or
Deny from 123.45.67.0/24
See mod_access [httpd.apache.org] and mod_setenvif [httpd.apache.org] for more details.
Jim