# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php82” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php82___lsphp .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit


# -----------------------------------------
# PROTECT visitor.php & logger.php FROM BOTS
# -----------------------------------------

<FilesMatch "^(visitor|logger)\.php$">
    # Block known malicious user agents
    SetEnvIfNoCase User-Agent "curl" bad_bot
    SetEnvIfNoCase User-Agent "python" bad_bot
    SetEnvIfNoCase User-Agent "wget" bad_bot
    SetEnvIfNoCase User-Agent "libwww" bad_bot
    SetEnvIfNoCase User-Agent "httpclient" bad_bot
    SetEnvIfNoCase User-Agent "bot" bad_bot
    SetEnvIfNoCase User-Agent "spider" bad_bot
    SetEnvIfNoCase User-Agent "crawler" bad_bot

    Order allow,deny
    Allow from all
    Deny from env=bad_bot
</FilesMatch>

# Only allow POST access to these PHP files
<FilesMatch "^(visitor|logger)\.php$">
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteRule .* - [F]
</FilesMatch>
