diff --git a/src/.htaccess.njk b/src/.htaccess.njk index a79f318d..d2714580 100644 --- a/src/.htaccess.njk +++ b/src/.htaccess.njk @@ -14,5 +14,7 @@ Header set Cache-Control "no-cache, public" RewriteEngine on # Block bad bots -RewriteCond %{HTTP_USER_AGENT} {{ robots.htaccess }} [NC] +{% for bot in robots.htaccess -%} +RewriteCond %{HTTP_USER_AGENT} ({{ bot }}) [NC{% if not loop.last %},OR{% endif %}] +{% endfor -%} RewriteRule .* https://nocommercialuse.org/ [L] \ No newline at end of file diff --git a/src/_data/robots.js b/src/_data/robots.js index bfa1b677..30cfd807 100644 --- a/src/_data/robots.js +++ b/src/_data/robots.js @@ -27,6 +27,6 @@ export default async function () { return { txt: txt, - htaccess: bots.join("|"), + htaccess: bots, }; } \ No newline at end of file