Replace spaces in User Agent names with wildcard

This commit is contained in:
Leilukin 2024-10-05 15:55:17 +08:00 committed by Helen Chong
parent 1bea50c3e9
commit a2c38d33f8

View File

@ -16,6 +16,6 @@ RewriteEngine on
# Block bad bots
{% for bot in robots.htaccess -%}
RewriteCond %{HTTP_USER_AGENT} ({{ bot }}) [NC{% if not loop.last %},OR{% endif %}]
RewriteCond %{HTTP_USER_AGENT} ({{ bot | replace(" ", ".*") }}) [NC{% if not loop.last %},OR{% endif %}]
{% endfor -%}
RewriteRule .* https://nocommercialuse.org/ [L]