From 03f78d22fd6bd34412b473ee498702f629384b56 Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Tue, 20 Aug 2024 00:21:02 +0800 Subject: [PATCH] Add .htaccess file --- .htaccess | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .htaccess diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..0181780 --- /dev/null +++ b/.htaccess @@ -0,0 +1,50 @@ +# Template to enable clean URLs for the Apache web server. + +RewriteEngine On +RewriteBase / +RewriteRule ^.+\.twig$ index.php [L] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond %{REQUEST_URI} ^/admin/.+ +ReWriteRule ^.+$ /admin/index.php [L] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^.+$ index.php [L] + + +# Block bad bots +RewriteEngine On +RewriteCond %{HTTP_USER_AGENT} (Amazonbot) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (Applebot) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (Applebot-Extended) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (Bytespider) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (CCBot) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (ChatGPT-User) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (Claude-Web) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (ClaudeBot) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (Diffbot) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (FacebookBot) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (FriendlyCrawler) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (GPTBot) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (Google-Extended) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (GoogleOther) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (GoogleOther-Image) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (GoogleOther-Video) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (ICC-Crawler) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (ImagesiftBot) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (Meta-ExternalAgent) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (Meta-ExternalFetcher) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (OAI-SearchBot) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (PerplexityBot) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (PetalBot) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (Scrapy) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (Timpibot) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (VelenPublicWebCrawler) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (YouBot) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (anthropic-ai) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (cohere-ai) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (facebookexternalhit) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (img2dataset) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (omgili) [NC,OR] +RewriteCond %{HTTP_USER_AGENT} (omgilibot) [NC] +RewriteRule .* https://nocommercialuse.org/ [L] \ No newline at end of file