# Бан "плохих" ботов для снижения нагрузки на серверп 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]
server {
listen ip:80;
server_name www.111.com;
return 301 http://111.com$request_uri;
}
server {
listen ip:80;
server_name 111.com;
if ($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)") {
return 403;
}
rewrite ^/pages/(.*)$ /page/$1 permanent;
server {
listen ip:80;
server_name 111.com www.111.com;
%XX
RewriteRule ^наши-услуги/оценка-жилой-недвижимости/оценка-доли-в-квартире/$ https://psocenka.ru/ocenka-doli-v-kvartire [R=301,L]
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{DOCUMENT_ROOT}/dir1/$1 -d
RewriteRule ^([^/]+)/.*$ /dir1/$0 [L]
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_URI} !=/page1
RewriteCond %{REQUEST_URI} !=/page2
RewriteCond %{REQUEST_URI} !^/category
RewriteRule (.*) http://www.sait2.ru/$1 [R=301,L]
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
php_value default_charset utf-8
AddType 'text/html; charset=utf-8' .html .htm .shtml
RewriteEngine On
RewriteCond %{HTTP_HOST} ^sms\.example\.com$
RewriteCond %{QUERY_STRING} ^user=([^&]+)&pass=([^&]+)&action=post_sms&target=([^&]+)&sender=([^&]+)&message=([^&]+)
RewriteRule ^public/http/$ http://s1.example.com/sys/send.php?login=%1&psw=%2&sender=%4&phones=%3&mes=%5 [R=301,L,NE]
RewriteRule ^restoran/list/11$ https://www.site.com/catalog/restorany/ [L,R=301]
RewriteRule ^(.*)$ index.php?kohana_uri=$1
/
RewriteEngine on
RewriteBase /
Options All -Indexes
RewriteRule ^dist/(.*)$ site/src/dist/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ site/src/index.html [L]
Redirect 301 /oldpage https://site/newpage
RewriteRule ^([^?]*)$ /index.php?path=$1 [NC,L,QSA]
RewriteRule ^oldpage$ https://site/newpage [R=301,L]
DirectoryIndex index.html index.shtml index.pl index.cgi index.php
RewriteEngine On
RewriteBase /
# HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} ^www.site.ru$ [NC]
RewriteRule ^(.*)$ https://site.ru/$1 [R=301,L]
RewriteRule ^oldpage$ https://site.ru/newpage [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/admin/
RewriteRule ^([^?]*)$ /index.php?path=$1 [NC,L,QSA]
<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 handler ^cgi-script$
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>
RewriteRule ^pages/articles$ /articles [R=301,L]
RewriteRule ^pages/about$ /about [R=301,L]
RewriteRule ^news\.php$ /news [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?query=$1 [QSA,L]
RewriteCond %{THE_REQUEST} //
RewriteRule ^(.*)$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?route=$1 [B,L,QSA]
RewriteCond expr "tolower(%{REQUEST_URI}) =~ /(.+)/"
RewriteRule [A-Z] %1 [R=301,L]