# Бан "плохих" ботов для снижения нагрузки на серверп 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]
server {
listen 80;
listen [::]:80; #Added IPv6 here too
# for certbot
location ^~ /.well-known/acme-challenge/ {
root /etc/nginx/ssl/coins;
}
location / {
return 301 https://my.cryptonot.io$request_uri;
}
}
RewriteRule ^/
/
In VirtualHost context, The Pattern will initially be matched against the part of the URL after the hostname and port, and before the query string (e.g. "/app1/index.html"). This is the (%-decoded) URL-path.
In per-directory context (Directory and .htaccess), the Pattern is matched against only a partial path, for example a request of "/app1/index.html" may result in comparison against "app1/index.html" or "index.html" depending on where the RewriteRule is defined.
rewrite ^/index$ / permanent;
rewrite ^(.+)/index$ $1 permanent;
rewrite ^/((.+)/)?index$ /$2 permanent;
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
#<(h\d+|a)\b.+?</\1>(*SKIP)(*F)|\b(СЛОВО)\b#isu
location ~ \.php$ {
try_files $uri =404;
location ~ ^/(.*\.php)$ {
try_files $uri /index.php?_route_=$1;