# Enable these lines when website is slow because of search engine indexation 
BrowserMatchNoCase "claudebot" bad_bot
BrowserMatchNoCase "facebookexternalhit/1.1" bad_bot
BrowserMatchNoCase "meta-externalagent/1.1" bad_bot
BrowserMatchNoCase "Python/3.10 aiohttp/3.9.3" bad_bot
# Order Deny,Allow
# Deny from env=bad_bot

# Apache <= 2.2
<IfModule !mod_authz_core.c>
    <IfModule mod_authz_host.c>
        Order Allow,Deny
        Allow from all
        Deny from env=bad_bot
        </IfModule>
</IfModule>

# Apache > 2.2
<IfModule mod_authz_core.c>
    <RequireAll>
        Require all granted
        Require not env bad_bot
    </RequireAll>
</IfModule>

# # Blocking Bot traffic except search bots. Explanation of RewriteCond lines:
# Line 1 stops unidentified bots.
# Line 2 stops bots including text: bot, crawl of robot zit.
# Line 3 enables access to robots including text: Bing, Google, etc.
# Line 4 block all useless bots including an acces denied message.

# RewriteEngine On
# RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
# RewriteCond %{HTTP_USER_AGENT} (bot|crawl|robot|facebook|spider)
# RewriteCond %{HTTP_USER_AGENT} !(Bing|Google|msn|MSR|Twitter|Yandex|Slurp|DuckDuck|Baidu|Exa) [NC]
# RewriteRule ^ - [F]
# # END Blocking Bot traffic except search bots


# Enable url_rewrite option.
RewriteEngine On

# MVC model: All requests will be send to index.php except gendex.php, sitemap.php and gezin.php. A router is used to handle the request.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^ index.php [QSA,L]