Skip to content

Instantly share code, notes, and snippets.

@mgeeky
Created November 9, 2016 13:45
Show Gist options
  • Save mgeeky/e0e9fd647b580e776ad4a6497ca9487b to your computer and use it in GitHub Desktop.
Save mgeeky/e0e9fd647b580e776ad4a6497ca9487b to your computer and use it in GitHub Desktop.
.htaccess to use in Phishing virtual hosts to prevent Bots/Crawlers from getting page and safely redirect 404 not founds.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^PHISHING-DOMAIN\.com$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ https://TARGET-DOMAIN.com%{REQUEST_URI} [L,R=301]
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} Googlebot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} AdsBot-Google [NC,OR]
RewriteCond %{HTTP_USER_AGENT} msnbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} AltaVista [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Slurp [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Mj12bot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} bingbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} DuckDuckBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} DuckDuckBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Baiduspider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} YandexBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} SimplePie [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Sogou [NC,OR]
RewriteCond %{HTTP_USER_AGENT} Exabot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} facebookexternalhit [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ia_archiver [NC]
RewriteRule . - [F,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment