Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -----------------------------------------
- # Block bots, spiders, crawlers
- # -----------------------------------------
- <IfModule mod_rewrite.c>
- RewriteEngine On
- # Cek User-Agent untuk bot umum
- RewriteCond %{HTTP_USER_AGENT} (?i)bot [OR]
- RewriteCond %{HTTP_USER_AGENT} (?i)spider [OR]
- RewriteCond %{HTTP_USER_AGENT} (?i)crawler [OR]
- RewriteCond %{HTTP_USER_AGENT} (?i)scraper [OR]
- RewriteCond %{HTTP_USER_AGENT} (?i)curl [OR]
- RewriteCond %{HTTP_USER_AGENT} (?i)wget [OR]
- RewriteCond %{HTTP_USER_AGENT} (?i)python [OR]
- RewriteCond %{HTTP_USER_AGENT} (?i)libwww [OR]
- RewriteCond %{HTTP_USER_AGENT} (?i)java [OR]
- RewriteCond %{HTTP_USER_AGENT} (?i)httpclient [OR]
- # Facebook / Meta
- RewriteCond %{HTTP_USER_AGENT} (?i)facebookexternalhit [OR]
- RewriteCond %{HTTP_USER_AGENT} (?i)facebot [OR]
- RewriteCond %{HTTP_USER_AGENT} (?i)meta-externalagent
- RewriteRule .* - [F,L]
- </IfModule>
- # -----------------------------------------
- # Optional: Blokir bot yang tidak sesuai standard
- # -----------------------------------------
- <IfModule mod_setenvif.c>
- SetEnvIfNoCase User-Agent "bot" bad_bot
- SetEnvIfNoCase User-Agent "spider" bad_bot
- SetEnvIfNoCase User-Agent "crawler" bad_bot
- SetEnvIfNoCase User-Agent "curl" bad_bot
- SetEnvIfNoCase User-Agent "wget" bad_bot
- SetEnvIfNoCase User-Agent "python" bad_bot
- # Facebook / Meta
- SetEnvIfNoCase User-Agent "facebookexternalhit" bad_bot
- SetEnvIfNoCase User-Agent "facebot" bad_bot
- SetEnvIfNoCase User-Agent "meta-externalagent" bad_bot
- <Limit GET POST HEAD>
- Order Allow,Deny
- Allow from all
- Deny from env=bad_bot
- </Limit>
- </IfModule>
- <Files "admin-ajax.php">
- RewriteEngine On
- RewriteCond %{HTTP_USER_AGENT} (badbot|scraper|crawl|bot) [NC]
- RewriteRule .* - [F,L]
- </Files>
- # BEGIN WordPress
- # Arahan (baris) antara "BEGIN WordPress" dan "END WordPress"
- # dihasilkan secara dinamis, dan hanya dapat dimodifikasi melalui filter WordPress.
- # Setiap perubahan pada arahan di antara penanda berikut akan ditimpa.
- <IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
- RewriteBase /
- RewriteRule ^index\.php$ - [L]
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule . /index.php [L]
- </IfModule>
- # END WordPress
- # php -- BEGIN cPanel-generated handler, do not edit
- # This domain inherits the “PHP” package.
- # php -- END cPanel-generated handler, do not edit
Advertisement