RewriteCond %{HTTP_HOST} ^(?:www\.)?domain\.ru$ [NC]
RewriteRule ^(spb|msk|rostov)/(.*) http://$1.domain.ru/$2 [R=301,L]RewriteCond %{HTTP_HOST} ^(?:www\.)?domain\.ru$ [NC]
RewriteCond %{REQUEST_URI} ^/(msk)/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/(spb)/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/(rostov)/(.*)$
RewriteRule ^ http://%1.domain.ru/%2 [R=301,L] нужно https://site/old переадресовать на https://site/new
RewriteRule ^old$ https://site/new? [R=301,L]RedirectMatch 403 config\.
RedirectMatch 403 ^/(?!favicons/browserconfig\.xml).*config\. $str = preg_replace('#<img[^>]*\ssrc="[^"]*knopka\.jpg"[^>]*>#i', '', $str); Order Deny, Allow
Order Deny,Allow $url = '/internal_redirect/http://domain.com/?test=123&test2=234';
header("X-Accel-Redirect: " . $url);location ~ ^/internal_redirect/(?<url>.+) {
internal;
proxy_pass $url$is_args$args;
} $str = $arrAllItem['Model'];
$str = preg_replace(
'#[A-Z][-/.,+*()\d]*\K[А-ЯЁ]+|[А-ЯЁ][-/.,+*()\d]*\K[A-Z]+#iu',
'<b style="color: blue;">$0</b>',
$str
);
echo $str;$str = $arrAllItem['Model'];
$str = preg_replace(
'#(?>\K[A-Z]+()|\K[А-ЯЁ]+()|[-/.,+*()\d]+)+?\1\2#iu',
'<b style="color: blue;">$0</b>',
$str
);
echo $str;RewriteCond %{REQUEST_URI} ^(.*?)\/{2,}(.*?)$ RewriteRule . %1/%2 [L,R=301] RewriteCond %{THE_REQUEST} // RewriteRule .* /$0 [R=301,L]
RewriteCond %{THE_REQUEST} //
RewriteRule .* /$0 [R=301,L]// нужно ограничить поиск чтобы не зациклило редирект.RewriteCond %{THE_REQUEST} ^[^?]+//
RewriteRule .* /$0 [R=301,L] (?:email":\["|\G(?!\A)",")\K[^"]+[^"]+@[^"]+(?<=email":\["[^\[\]]+)./feed/$RewriteCond %{REQUEST_URI} ./feed/$
RewriteRule ^.*$ https://example.com/v5dl/? [R=301,L]RewriteRule /feed/$ https://example.com/v5dl/? [R=301,L] (?!...)$text = preg_replace(
'#\[url=(?!https?://site\.ru)\S*\](\[img.*?\]\S*\[/img\])\[/url\]#i',
'$1',
$text
);$white_list = ['site3.ru', 'site4.ru'];
$text = '
[url=https://site1.ru/page][img]https://site1.ru/file.jpg[/img][/url]
[url=https://site2.ru/page][img]https://site2.ru/file.jpg[/img][/url]
[url=https://site3.ru/page][img]https://site3.ru/file.jpg[/img][/url]
[url=https://site4.ru/page][img]https://site4.ru/file.jpg[/img][/url]
';
$text = preg_replace_callback(
'#\[url=(\S*)\](\[img.*?\]\S*\[/img\])\[/url\]#i',
function ($m) use($white_list) {
$host = parse_url($m[1], PHP_URL_HOST);
if (in_array($host, $white_list))
return $m[0];
return $m[2];
},
$text
);