Replace spaces in User Agent names with wildcard

This commit is contained in:
Helen Chong 2024-10-05 15:55:17 +08:00
parent 974a3dea62
commit 346398e85a
1 changed files with 1 additions and 1 deletions

View File

@ -16,6 +16,6 @@ RewriteEngine on
# Block bad bots # Block bad bots
{% for bot in robots.htaccess -%} {% 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 -%} {% endfor -%}
RewriteRule .* https://nocommercialuse.org/ [L] RewriteRule .* https://nocommercialuse.org/ [L]