Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
679 views
in Q2A Core by
edited by

Today i edit  my htaccess. I block bad bot my server. This ic code normal edit?

Options All +FollowSymLinks 
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} robots.txt$ [NC]
RewriteRule ^([^/]+) $1 [L]
RewriteCond %{HTTP_HOST} ^surak-zhauap\.kz
RewriteRule ^(.*)$ http://szh.kz/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.surak-zhauap\.kz
RewriteRule ^(.*)$ http://szh.kz/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.szh\.kz
RewriteRule ^(.*)$ http://szh.kz/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^46.254.16.9
RewriteRule ^(.*)$ http://szh.kz/$1 [R=301,L]
#RewriteBase /
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
 
RewriteCond %{HTTP_USER_AGENT} .*Slurp.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Ask\sJeeves.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*HP\sWeb\sPrintSmart.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*HTTrack.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*IDBot.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Indy\sLibrary.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*ListChecker.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*MSIECrawler.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*NetCache.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Nutch.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*RPT-HTTPClient.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*rulinki\.ru.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Twiceler.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*WebAlta.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Webster\sPro.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*www\.cys\.ru.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Wysigot.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Yeti.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Accoona.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*CazoodleBot.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*CFNetwork.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*ConveraCrawler.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*DISCo.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Download\sMaster.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*FAST\sMetaWeb\sCrawler.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Flexum\sspider$ [OR]
RewriteCond %{HTTP_USER_AGENT} .*Gigabot.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*HTMLParser.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*ia_archiver.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*ichiro.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*IRLbot.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*km\.ru\sbot$ [OR]
RewriteCond %{HTTP_USER_AGENT} .*kmSearchBot.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*libwww-perl.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Lupa\.ru.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*LWP::Simple.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*lwp-trivial.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Missigua.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*MJ12bot.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Offline\sExplorer.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*OmniExplorer_Bot.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*PEAR.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*psbot.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Python.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*rulinki\.ru.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*SMILE.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Speedy.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Teleport\sPro.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*TurtleScanner.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*voyager.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Webalta.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*WebCopier.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*WebData.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*WebZIP.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Wget.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Yanga.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Yeti.* [OR]
RewriteCond %{HTTP_USER_AGENT} .*Sputnik.*
RewriteRule .*$ - [F]
</IfModule>
 
# CACHING
<IfModule mod_expires.c>
    ExpiresActive On    
    ExpiresByType text/css     "access plus 1 month"
    ExpiresByType text/javascript             "access plus 1 month"
    ExpiresByType application/javascript     "access plus 1 month"
    ExpiresByType application/x-javascript     "access plus 1 month"    
    ExpiresByType image/ico         "access plus 1 month"
    ExpiresByType image/x-icon         "access plus 1 month"
    ExpiresByType image/gif         "access plus 1 month"
    ExpiresByType image/jpg         "access plus 1 month"
    ExpiresByType image/jpeg         "access plus 1 month"
    ExpiresByType image/png         "access plus 1 month"    
    ExpiresByType application/x-shockwave-flash     "access plus 1 month"    
    ExpiresByType video/mp4         "access plus 1 month"
    ExpiresByType video/ogg         "access plus 1 month"
    ExpiresByType video/webm         "access plus 1 month"
</IfModule>
<IfModule mod_gzip.c>
    mod_gzip_on         Yes
    mod_gzip_dechunk    Yes
    mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
    mod_gzip_item_include mime ^text\.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image\.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
 
Thanks.
related to an answer for: Filters bot with htaccess

Please log in or register to answer this question.

...