leilukin-site/.htaccess

17 lines
990 B
ApacheConf
Raw Normal View History

ErrorDocument 404 /404.html
<FilesMatch "\.(ico|svg|avif|webp|jpg|jpeg|png|gif|woff2)$">
Header set Cache-Control "max-age=31536000, public"
</FilesMatch>
<FilesMatch "\.(css|js)$">
Header set Cache-Control "no-cache, public"
2024-08-19 16:23:25 +00:00
</FilesMatch>
2024-08-19 16:25:27 +00:00
RewriteEngine on
# Redirect obfuscated email links to mailto link
RewriteRule ^.*emailme/.*$ "mailto:contact@leilukin.com" [R=301,L]
2024-08-19 16:23:25 +00:00
# Block bad bots
RewriteCond %{HTTP_USER_AGENT} (AI2Bot|Ai2Bot-Dolma|Amazonbot|anthropic-ai|Applebot-Extended|Bytespider|ChatGPT-User|Claude-Web|ClaudeBot|cohere-ai|Diffbot|DuckAssistBot|FacebookBot|FriendlyCrawler|Google-Extended|GoogleOther|GoogleOther-Image|GoogleOther-Video|GPTBot|iaskspider/2.0|ICC-Crawler|ImagesiftBot|img2dataset|ISSCyberRiskCrawler|Kangaroo.*Bot|Meta-ExternalAgent|Meta-ExternalFetcher|OAI-SearchBot|omgili|omgilibot|PanguBot|PerplexityBot|PetalBot|Scrapy|Sidetrade.*indexer.*bot|Timpibot|VelenPublicWebCrawler|Webzio-Extended|YouBot) [NC]
2024-08-19 16:23:25 +00:00
RewriteRule .* https://nocommercialuse.org/ [L]