From 346398e85a63ab0b83234f83ecc6125f75ecac0d Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Sat, 5 Oct 2024 15:55:17 +0800 Subject: [PATCH] Replace spaces in User Agent names with wildcard --- src/.htaccess.njk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/.htaccess.njk b/src/.htaccess.njk index bf343d23..2b3e8d69 100644 --- a/src/.htaccess.njk +++ b/src/.htaccess.njk @@ -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] \ No newline at end of file