location
и rewrite
для сопоставления используют URI запроса в нормализованном виде, т.е. уже после декодирования текста, заданного в виде %XX
.$request_uri
. Там он будет целиком (с аргументами).if ($request_uri ~ "^/%40(.*)$") {
return 301 /@$1;
}
Как вариант что-то вродеRewriteCond %{HTTP:X-Forwarded-Proto} http(s) [NC] #RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] RewriteRule ^331/$ /best/http%1/%2/3 [L,R=301]
с коментом работает %1 а вот со вторым кондом уже нет ;(
!
не затрёт результаты предыдущего.RewriteCond %{HTTP:X-Forwarded-Proto} http(s)| [NC]
RewriteCond %{HTTP_HOST} !^www\.(.*) [NC]
RewriteRule ^(.*)$ http%1://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond "s %{HTTPS} %{HTTP_HOST}"
s on site.ru
s on www.site.ru
s off site.ru
s off www.site.ru
RewriteCond "s-%{HTTPS} %{HTTP_HOST}" "^(?:(s)-on|\S+) (?!www\.)(.*)" [NC]
RewriteRule ^(.*)$ http%1://www.%2/$1 [R=301,L]
RewriteCond "s-%{HTTPS} %{HTTP_HOST}" "^(?:(s)-on|\S+) www\.(.*)" [NC]
RewriteRule ^(.*)$ http%1://%2/$1 [R=301,L]
RewriteRule "^/foo$" "/bar"
/
/
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.
(?=\d{0,4}[-])
(?<=\s)\d(?=\d{0,4}[-])(?:[-]?\d){5}(?=\s)
(?:(?:[-]())?\d){5}\1
(?<=\s)\d(?:(?:[-]())?\d){5}\1(?=\s)
echo preg_replace('~(\n)[\r\n]+|(<text>.*?</text>)~isu', '$1$2', $content);
echo preg_replace('~[\r\n]+|<text>.*?</text>(*SKIP)(*F)~isu', "\n", $content);
echo preg_replace('~<code>(.*?)(?=</code>)|<[^>]+>~siu', ' $1', $txt);
echo preg_replace('~(?<=<code>).*?\K</code>|<[^>]+>~siu', ' ', $txt);