########## Точто будет пробовать и просить сделать RSFirewall
php_flag register_globals off
php_value disable_functions show_source
php_value disable_functions system
php_value disable_functions shell_exec
php_value disable_functions passthru
php_value disable_functions exec
php_value disable_functions phpinfo
php_value disable_functions popen
php_value disable_functions proc_open
php_value open_basedir "/home/site/public_html/"
AddDefaultCharset utf-8
Options -Indexes
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} OFF
RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteCond %{HTTP_REFERER} !^http(s)?://([a-z0-9-]+.)*вашсайт.домен(:80)?(/.*)? [NC]
RewriteRule .*[Zz][Ii][Pp]$|.*[Rr][Aa][Rr]$ https://вашсайт.домен/ [L,R]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} sbp(=|%20|%3D) [OR]
RewriteCond %{QUERY_STRING} sb_authorname(=|%20|%3D)
########## Блокируем плохиt боты и роботы ##########
SetEnvIfNoCase user-Agent ^FrontPage [NC,OR]
SetEnvIfNoCase user-Agent ^Java.* [NC,OR]
SetEnvIfNoCase user-Agent ^Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) [NC,OR]
SetEnvIfNoCase user-Agent ^Microsoft.URL [NC,OR]
SetEnvIfNoCase user-Agent ^MSFrontPage [NC,OR]
SetEnvIfNoCase user-Agent ^Offline.Explorer [NC,OR]
SetEnvIfNoCase user-Agent ^[Ww]eb[Bb]andit [NC,OR]
SetEnvIfNoCase user-Agent ^Zeus [NC]
<limit get="" post="" head="">
Order Allow,Deny
Allow from all
Deny from env=bad_bot
</limit>
####### блокируем известные типы атак и программ, используемые для атак на сайты.#####
BrowserMatchNoCase ^libwww-perl blocktheaccess
BrowserMatchNoCase .*libwww-FM.* blocktheaccess
BrowserMatchNoCase ^wget blocktheaccess
BrowserMatchNoCase ^TeamSoft blocktheaccess
BrowserMatchNoCase "^Express WebPictures" blocktheaccess
BrowserMatchNoCase ^WebAuto blocktheaccess
BrowserMatchNoCase ^eCatch blocktheaccess
BrowserMatchNoCase ^InterGet blocktheaccess
BrowserMatchNoCase ^DOWNLOAD blocktheaccess
BrowserMatchNoCase ^Java1 blocktheaccess
BrowserMatchNoCase "^Internet Ninja" blocktheaccess
BrowserMatchNoCase "^Teleport Pro" blocktheaccess
BrowserMatchNoCase ^AllThumbs blocktheaccess
BrowserMatchNoCase ^Pockey-GetHTML blocktheaccess
BrowserMatchNoCase .*DnloadMage.* blocktheaccess
BrowserMatchNoCase .*HTTrack.* blocktheaccess
BrowserMatchNoCase .*WebLeacher.* blocktheaccess
BrowserMatchNoCase "^Microsoft URL Control" blocktheaccess
BrowserMatchNoCase ^Webdup blocktheaccess
BrowserMatchNoCase ^WebReaper blocktheaccess
BrowserMatchNoCase ^WebSauger blocktheaccess
BrowserMatchNoCase "^Mister PiX" blocktheaccess
BrowserMatchNoCase "^Offline Explorer" blocktheaccess
BrowserMatchNoCase "^Download Ninja" blocktheaccess
BrowserMatchNoCase ^Linkbot blocktheaccess
BrowserMatchNoCase ".*Link Sleuth.*" blocktheaccess
BrowserMatchNoCase ^SiteSnagger blocktheaccess
SetEnvIf Request_URI ".*/phpwcms" blocktheaccess
SetEnvIf Request_URI ".*/nonexistentfile.php$" blocktheaccess
SetEnvIf Request_URI ".*/xmlrpc.php$" blocktheaccess
SetEnvIf Request_URI ".*/adxmlrpc.php$" blocktheaccess
SetEnvIf Request_URI ".*/cmd.php$" blocktheaccess
SetEnvIf Request_URI ".*shell.php$" blocktheaccess
SetEnvIf Request_URI ".*r57\.php" blocktheaccess
SetEnvIf Request_URI ".*c99\.php" blocktheaccess
SetEnvIf Request_URI ".*mod_pxt_latest\.php" blocktheaccess
SetEnvIf Request_URI ".*functions_mod_user\.php" blocktheaccess
SetEnvIf Request_URI ".*favorites\.php" blocktheaccess
SetEnvIf Request_URI ".*configuration\.php" blocktheaccess
SetEnvIf Request_URI ".*component\.php" blocktheaccess
SetEnvIf Request_URI ".*controller\.php" blocktheaccess
SetEnvIf Request_URI ".*router\.php" blocktheaccess
SetEnvIf Request_URI ".*mosConfig_absolute_path" blocktheaccess
SetEnvIf Request_URI ".*^(.*)CAST(.*)" blocktheaccess
SetEnvIf Request_URI ".*^(.*)DECLARE(.*)" blocktheaccess
SetEnvIf Request_URI ".*base64_encode.*\(.*\)" blocktheaccess
SetEnvIf Request_URI ".*(\<|%3C).*script.*(\>|%3E)" blocktheaccess
SetEnvIf Request_URI ".*GLOBALS(=|\[|\%[0-9A-Z]{0,2})" blocktheaccess
SetEnvIf Request_URI ".*_REQUEST(=|\[|\%[0-9A-Z]{0,2})" blocktheaccess
SetEnvIfNoCase User-Agent "^libwww-perl*" blocktheaccess
Order deny,allow
Deny from env=blocktheaccess
####### / блокировки атак и программ#####
<FilesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
</FilesMatch>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A600
ExpiresByType image/x-icon A2592000
ExpiresByType application/x-javascript A604800
ExpiresByType text/css A604800
ExpiresByType text/javascript A604800
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/html A60
</IfModule>