Created
June 28, 2012 02:37
-
-
Save mhulse/3008410 to your computer and use it in GitHub Desktop.
Wordpress demo .htaccess file...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/ | |
<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$"> | |
order allow,deny | |
deny from all | |
</FilesMatch> | |
# http://css-tricks.com/snippets/htaccess/shock-teenage-gangsters-with-wp-config-redirect/ | |
Redirect 301 /wp-config.php http://svr.gov.ru/ | |
# Turn on the rewrite engine: | |
RewriteEngine on | |
RewriteBase / | |
# BEGIN WordPress | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
# END WordPress | |
# 5G BLACKLIST/FIREWALL | |
# @ http://perishablepress.com/5g-blacklist/ | |
# 5G:[QUERY STRINGS] | |
RewriteCond %{QUERY_STRING} (environ|localhost|mosconfig|scanner) [NC,OR] | |
RewriteCond %{QUERY_STRING} (menu|mod|path|tag)\=\.?/? [NC,OR] | |
RewriteCond %{QUERY_STRING} boot\.ini [NC,OR] | |
RewriteCond %{QUERY_STRING} echo.*kae [NC,OR] | |
RewriteCond %{QUERY_STRING} etc/passwd [NC,OR] | |
RewriteCond %{QUERY_STRING} \=\\%27$ [NC,OR] | |
RewriteCond %{QUERY_STRING} \=\\\'$ [NC,OR] | |
RewriteCond %{QUERY_STRING} \.\./ [NC,OR] | |
RewriteCond %{QUERY_STRING} \? [NC,OR] | |
RewriteCond %{QUERY_STRING} \: [NC,OR] | |
RewriteCond %{QUERY_STRING} \[ [NC,OR] | |
RewriteCond %{QUERY_STRING} \] [NC] | |
RewriteRule .* - [F] | |
# 5G:[USER AGENTS] | |
<ifModule mod_setenvif.c> | |
SetEnvIfNoCase User-Agent ^$ keep_out | |
SetEnvIfNoCase User-Agent (casper|cmsworldmap|diavol|dotbot) keep_out | |
SetEnvIfNoCase User-Agent (flicky|ia_archiver|jakarta|kmccrew) keep_out | |
SetEnvIfNoCase User-Agent (libwww|planetwork|pycurl|skygrid) keep_out | |
SetEnvIfNoCase User-Agent (purebot|comodo|feedfinder|turnit) keep_out | |
SetEnvIfNoCase User-Agent (zmeu|nutch|vikspider|binlar|sucker) keep_out | |
<limit GET POST PUT> | |
Order Allow,Deny | |
Allow from all | |
Deny from env=keep_out | |
</limit> | |
</ifModule> | |
# 5G:[REQUEST STRINGS] | |
<ifModule mod_alias.c> | |
RedirectMatch 403 (https?|ftp|php)\:// | |
RedirectMatch 403 /(cgi|https?|ima|ucp)/ | |
RedirectMatch 403 /(Permanent|Better)$ | |
RedirectMatch 403 (\=\\\'|\=\\%27|/\\\'/?|\)\.css\()$ | |
RedirectMatch 403 (\,|//|\)\+|/\,/|\{0\}|\(/\(|\.\.\.|\+\+\+|\||\\\"\\\") | |
RedirectMatch 403 \.(cgi|asp|aspx|cfg|dll|exe|jsp|mdb|sql|ini|rar)$ | |
RedirectMatch 403 /(contac|fpw|install|pingserver|register)\.php$ | |
RedirectMatch 403 (base64|crossdomain|localhost|wwwroot|e107\_) | |
RedirectMatch 403 (eval\(|\_vti\_|\(null\)|echo.*kae|config\.xml) | |
RedirectMatch 403 \.well\-known/host\-meta | |
RedirectMatch 403 /function\.array\-rand | |
RedirectMatch 403 \)\;\$\(this\)\.html\( | |
RedirectMatch 403 proc/self/environ | |
RedirectMatch 403 msnbot\.htm\)\.\_ | |
RedirectMatch 403 /ref\.outcontrol | |
RedirectMatch 403 com\_cropimage | |
RedirectMatch 403 indonesia\.htm | |
RedirectMatch 403 \{\$itemURL\} | |
RedirectMatch 403 function\(\) | |
RedirectMatch 403 labels\.rdf | |
RedirectMatch 403 /playing.php | |
RedirectMatch 403 muieblackcat | |
</ifModule> | |
# 5G:[BAD IPS] | |
<limit GET POST PUT> | |
Order Allow,Deny | |
Allow from all | |
# uncomment/edit/repeat next line to block IPs | |
# Deny from 123.456.789 | |
</limit> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment