AddDefaultCharset utf-8
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[^?]+//
RewriteRule ^(.*)$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]
RewriteCond %{REQUEST_URI} !^/folder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^.*$ $0.php [L,QSA]
RewriteCond %{REQUEST_URI} !^/folder/
RewriteCond %{THE_REQUEST} (\S+)\.php
RewriteRule ^ %1 [R=301,L]
RewriteCond %{THE_REQUEST} ^\S+\s/flowers\.php
RewriteRule ^ https://my.site/my-flowers [R=301,L]
RewriteRule ^my-flowers$ /flowers.php [L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^flowers\.php https://my.site/my-flowers [R=301,L]
RewriteRule ^my-flowers$ /flowers.php [L]
RewriteCond %{QUERY_STRING} ^(|.*?&)param1=[^&]*&?(.*)
RewriteRule .* /$0?%1%2 [R=301,L]
AddType application/x-httpd-php .html .htm
if ($request_uri ~ "/index\.htm") {
return 301 /;
}
if ($request_uri ~ "^([^.?]+)\.htm") {
return 301 $1;
}
location / {
try_files $uri $uri/ $uri.htm$is_args$args;
}
location ~ \.htm {
try_files $uri =404;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
RewriteCond %{HTTP_HOST} ^(www\.)?domain1\.ru$ [NC]
RewriteRule ^subfolder.* http://domain2.ru/$0 [L,R=301]
RewriteRule ^\]\xFD\xEB\xE5\xEA\xF2\xF0\xEE\xE8\xE7\xE5\xF0\xE8\xF2\xE5\xEB\xFC\xED\xFB\xF5 https://site.ru/ [R=301,L]
RewriteCond %{QUERY_STRING} ^_route_=xxx$
RewriteRule ^(.*)$ https://site.ru/yyy? [R=301,L]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^([0-9.]+/.+)$ ../download.php?file=$1 [L]
RewriteRule (.*) index.html [L]
RewriteRule ^catalog/razdel-\(strahovka\)/$ https://site.ru/catalog/razdeli/razdel-/? [R=301,L]
В итоге перелинковка идет на https://newsite.ru/pesok/kvarceviy-pesok/, то есть добавляет в конец лишнее
Redirect 301 / https://newsite.ru/
оно и срабатывает.Redirect 301 /pesok/kvarceviy-pesok/ https://newsite.ru/pesok/
Redirect 301 / https://newsite.ru/
RedirectMatch 301 ^/$ https://newsite.ru/
RedirectMatch 301 ^/pesok/kvarceviy-pesok/$ https://newsite.ru/pesok/
RewriteRule ^main$ main.html [L]
/main
/main/
нужен шаблон ^main/$
RewriteRule ^main/$ main.html [L]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ https://site.ru/$1 [R=301,L]
RewriteCond %{ENV:HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ https://site.ru/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) index.php?route=$1 [L,QSA]