Блокування seo-ботів в файлі htaccess

74
htaccess

#Blocking bots
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (SemrushBot|MJ12bot|AhrefsBot) [NC]
RewriteRule .* – [F,L]
#End Blocking bots

# Redirects http -> https , www -> non www
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTP_HOST} ^domain_name\.ua$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domain_name\.ua$
RewriteRule .* https://domain_name.ua%{REQUEST_URI} [R=301,L]

# BEGIN Hide My Links
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} “.*AhrefsBot.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*MJ12bot.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*rogerBot.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*MegaIndex\.ru/2\.0.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*ia_archiver.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*Baiduspider.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*archive\.org_bot.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*BLEXBot.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*LinkpadBot.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*spbot.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*Serpstatbot.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*exabot.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*boitho.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*psbot.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*sogou.*” [OR]
RewriteCond %{HTTP_USER_AGENT} “.*Slurp.*”
RewriteRule “.*” “-” [F]
</IfModule>
# END Hide My Links

# FIX ERR_TOO_MANY_REDIRECTS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
#END FIX ERR_TOO_MANY_REDIRECTS

#REDIRECTS FROM ALL SUBDOMAINS TO MAIN PAGE
#(ALIASES OF SUBDOMAINS SHOULD BE ADDED)

RewriteCond %{HTTP_HOST} ^.+\.domain\.com$
RewriteRule ^.*$ https://domain.com/

Читайте також:  SEO та SEM: у чому різниця?

ЗАЛИШИТИ КОМЕНТАР

Введіть свій коментар!
Введіть тут своє ім'я