regex - .htaccess condition will omit ranges of ip addresses, but that i can modify as i see valid addresses in logs -
i have following in .htaccess file:
rewritecond %{remote_addr} (\b88\.78\.30\.\d{1,3}|\b182\.\d{1,3}\.\d{1,3}\.\d{1,3}|etc..) rewriterule (.*) http://www\.foobar\.com/botcatch.html [i,rp]
as @ logs, want exclude valid ip addresses in class d range. want add example 88.78.30.20 not included in list. have looked @ negative lookaheads in many posts on board. still don't them.
negative lookaheads 0 length matches when fail see something, here supplement mentioned:
rewritecond %{remote_addr} (\b88\.78\.30\.(?!20)\d{1,3}|\b182\.\d{1,3}\.\d{1,3}\.\d{1,3}|etc..)
note chainable can following too:
rewritecond %{remote_addr} (\b88\.78\.30\.(?!20|40)\d{1,3}|\b182\.\d{1,3}\.\d{1,3}\.\d{1,3}|etc..)
so if word boundary followed 88.78.30.
, not 20
or 40
1 3 digits.
Comments
Post a Comment