AddDefaultCharset utf-8
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine On
# Бан "плохих" ботов для снижения нагрузки на серверп
RewriteCond %{HTTP_USER_AGENT} (AhrefsBot|MJ12bot|DotBot|BUbiNG\ Crawler|BUbiNG|FaceBook\ Crawler|FaceBook|SemrushBot|LinkdexBot|Alexa\ Robot|Alexa|Ads.txt-crawler|Powermarks|GrapeshotCrawler|grapeshot|SimplePie|360Spider|CCBot|SeznamBot|LinkpadBot|BLEXBot) [NC]
RewriteRule .* - [R=403,L]
# Обратная совместимость со старыми страницами
RewriteRule ^pages/(.*)$ /page/$1 [L,R=301]
# Редирект с WWW
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$
http://%1/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
# API админ панели
RewriteRule ^admin/api/(.*) /adminko/?act=api&api=$1 [NS,L]