Skip to content

Instantly share code, notes, and snippets.

@artlung
Created July 17, 2025 19:47
Show Gist options
  • Save artlung/67acf245d9eda15d41c18275a2ebd738 to your computer and use it in GitHub Desktop.
Save artlung/67acf245d9eda15d41c18275a2ebd738 to your computer and use it in GitHub Desktop.
.htaccess llm blocking
# https://serverfault.com/questions/1162651/blocking-bots-with-apache-htaccess
RewriteCond %{HTTP_USER_AGENT} ^.*(AdsBot-Google|Amazonbot|anthropic-ai|Applebot|Applebot-Extended|AwarioRssBot|AwarioSmartBot|Bytespider|CCBot|ChatGPT|ChatGPT-User|Claude-Web|ClaudeBot|cohere-ai|DataForSeoBot|Diffbot|GPTBot|ImagesiftBot|magpie-rawler|omgili|Omgilibot|peer39_crawler|PerplexityBot|YouBot|AhrefsBot|Barkrowler|SemrushBot|DotBot).*$ [NC]
# https://www.jwz.org/blog/2025/05/user-agent-blocking/#comment-259200
RewriteRule .* - [F,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment