# skip file: ftp: and mailto: urls
-^(file|ftp|mailto):

# skip image and other suffixes we can't parse or are not likely to be relevant
# if you want to crawl images or videos or archives then you should comment out this line
-(?i)\.(apk|deb|cab|iso|gif|jpg|png|svg|ico|css|sit|eps|wmf|rar|tar|jar|zip|gz|bz2|rpm|tgz|mov|exe|jpeg|jpe|bmp|js|mpg|mp3|mp4|m4a|ogv|kml|wmv|swf|flv|mkv|m4v|webm|ra|wma|wav|avi|xspf|m3u)(\?|&|$)

# skip URLs with slash-delimited segment that repeats 3+ times, to break loops
# very time-consuming : use BasicURLFilter instead
# -.*(/[^/]+)/[^/]+\1/[^/]+\1/

# exclude localhost and equivalents to avoid that information
# can be leaked by placing faked links pointing to web interfaces
# of services running on the crawling machine (e.g., Elasticsearch,
# Storm)
#
# NOTE: these rules judge the bytes of the URL only. A host name which
# resolves into one of the ranges below is not caught here; the IP
# address filter (http.filter.ipaddress.exclude) sees the address the
# fetcher actually connects to and is the authoritative check.
#
# - exclude localhost and loop-back addresses, including the abbreviated
#   and integer IPv4 forms the resolver maps to 127.0.0.1
#     http://localhost:8080
#     http://LOCALHOST:8080
#     http://127.0.0.1/ .. http://127.255.255.255/
#     http://127.1/
#     http://2130706433/
#     http://[::1]/
-^(?i)https?://(?:localhost|127(?:\.(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))){0,3}|\[::1\])(?::\d+)?(?:/|$)
#     loopback reached through an IPv4-mapped or fully expanded IPv6 literal
#     (::ffff:127.0.0.1 and 0:0:0:0:0:0:0:1 resolve to loopback as well)
-^(?i)https?://\[(?:::ffff:127\.|(?:0*:){7}0*1\])
#     the integer form of an IPv4 address resolves to the address it encodes
#     (e.g. http://2130706433/ is 127.0.0.1); such URLs are blocked outright,
#     a crawl that needs one can rewrite it to its dotted form
-^https?://\d{1,10}(?::\d+)?(?:/|$)
#
# - exclude private IP address spaces
#     10.0.0.0/8
-^https?://(?:10(?:\.(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))){3})(?::\d+)?(?:/|$)
#     192.168.0.0/16
-^https?://(?:192\.168(?:\.(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))){2})(?::\d+)?(?:/|$)
#     172.16.0.0/12
-^https?://(?:172\.(?:1[6789]|2[0-9]|3[01])(?:\.(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))){2})(?::\d+)?(?:/|$)
#     169.254.0.0/16 (link-local, e.g. cloud instance metadata services)
-^https?://(?:169\.254(?:\.(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))){2})(?::\d+)?(?:/|$)
#     100.64.0.0/10 (carrier-grade NAT): second octet 64 to 127
-^https?://(?:100\.(?:6[4-9]|[7-9][0-9]|1[01][0-9]|12[0-7])(?:\.(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))){2})(?::\d+)?(?:/|$)
#     0.0.0.0/8 ("this network")
-^https?://(?:0(?:\.(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))){1,3})(?::\d+)?(?:/|$)
#     IPv6 unique-local (fc00::/7) and link-local (fe80::/10) addresses
-^(?i)https?://\[(?:f[cd][0-9a-f]{2}|fe[89ab][0-9a-f]):[0-9a-f:]+\](?::\d+)?(?:/|$)

# accept anything else
+.
