Forum Moderators: phranque
Is there a way to block an IP from accessing a page
<FilesMatch "\.html$"> RewriteCond %{REMOTE_ADDR} ^123\.456\.789\.
RewriteRule ^MyPage\.html - [F] RewriteCond %{REMOTE_ADDR} ^xxx\.xxx\.xxx\.xxx
RewriteRule ^mypage/$ - [F] RewriteCond %{REMOTE_ADDR} ^xxx.xxx.xxx.xxx
RewriteRule ^mypage/$ - [F] xxx.xxx.xxx.xxx/24 1) I know the reason why a backslash is used, period means any character, but is it really necessary in this case (for an IP)? The following worked just as fine.
2) Using this method, is it possible to block an IP range using a CIDR value? For example:
xxx.xxx.xxx.xxx/24
The following worked just as fine.
or (overkill)
146\.185\.253\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-5][0-9])$
<IF "%{REQUEST_URI} ^/mypage/$">
Require not ip 111.111.111.0/24
</IF> it doesn't work for a rewritten URL like /mypage
Deny from...