Modifiers
Particular items can be restricted to print only for responses with specific HTTP status codes by placing a comma-separated list of status codes immediately following the "%". The status code list may be preceded by a "!" to indicate negation.
%!
перечислить через запятую коды ответов которые нужно исключить.CustomLog "logs/access_log" combined "expr=!%{REQUEST_STATUS} -in {'200', '301','302'}"
RewriteCond %{REQUEST_URI} ^/shop/shop/(.*)$
RewriteRule ^(.*)$ /shop/%1 [R=301,L]
RewriteRule ^shop(/shop/.*) $1 [R=301,L]
Пробовал добавлять что-то типа (\?|\$) - не работает.
Что ему туда скормить?
(.+?)(\?|$)
Unicode property support
Another special sequence that may appear at the start of a pattern is (*UCP). This has the same effect as setting the PCRE_UCP option: it causes sequences such as \d and \w to use Unicode properties to determine character types, instead of recognizing only characters with codes less than 128 via a lookup table.
\w
совпадало не только с латиницей нужно добавить (*UCP).(*UCP)\w+
RewriteRule ^/
<VirtualHost>
./
.RewriteRule ^first/second/$ https://site.com/first/target/ [R=301,L]
map $request_uri $index {
default "0";
"~/bitrix/admin/" "0";
"~/auth/" "0";
"~^(.*)index\.(?:php|html)(\?.+)?" "$1$2";
"~^/\?old=\d+&(.+)" "/?$1";
"~^/\?old=\d+" "/";
}
if ($index != 0) {
return 301 $index;
}
(^.*:.*):(.*$)
$1
^.*:.*\K:.*$
, а строку замены оставить пустой.Redirect 301 /опалубка-колонн / https://site.su/category/prodazha-opalubki/prodazha-opalubki-kolonn/
Redirect 301 /опалубка-колонн/ https://site.su/category/prodazha-opalubki/prodazha-opalubki-kolonn/
Redirect 301 "/опалубка-колонн /" https://site.su/category/prodazha-opalubki/prodazha-opalubki-kolonn/
RewriteCond %{HTTP_HOST} ^subdomain2\.main-site\.ru$ [NC]
RewriteRule ^$ http://subdomain.main-site.ru/some-url [R=301,L]
RewriteCond %{HTTP_HOST} ^subdomain2\.main-site\.ru$ [NC]
RewriteRule ^$ http://subdomain.main-site.ru/some-url [P]
.*
точка совпадает с любыми символами кроме "\n". Чтобы точка совпадала и с символами новой строки достаточно добавить (?s)'pattern' => '(^(?xi)
(?=(?:.*[0-9]){2})
(?=(?:.*[a-z]){2})
(?=(?:.*[!"#$%&\'()*+,./:;<=>?@\[\]^_`{|}~-]){2})
.{6,}$
)'
Только что попробовали: оказывается если включить php в режиме модуля, то авторизация проходит, а если как CGI то не работает
CGIPassAuth on
$text = preg_replace(
'#<a\b.*?</a>(*SKIP)(*F)|ipsum dolor#s',
'<a href="/article/2020">$0</a>',
$text
);
RewriteCond %{REQUEST_URI} ^/katalog/categoriya/podcategoriya1/ RewriteRule ^.*$ https://site.ru/katalog/categoriya/podcategoriya2/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/katalog/categoriya/podcategoriya1/(.*)
RewriteRule ^.*$ https://site.ru/katalog/categoriya/podcategoriya2/%1 [R=301,L]