Redirect /article55 https://ritual-moskva.ru/url1
Redirect /article70 https://ritual-moskva.ru/url2
RedirectMatch ^/article[0-9]+ https://ritual-moskva.ru/url3
Redirect 301 /article55 https://ritual-moskva.ru/url1
Redirect 301 /article70 https://ritual-moskva.ru/url2
RedirectMatch 301 ^/article[0-9]+ https://ritual-moskva.ru/url3
www.
а вся остальная часть строки, например, mysite.ru будет захвачена в переменную %1 RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.mysite\.ru [NC]
RewriteRule ^(.*)$ https://mysite.ru/$1 [R=301,L]
ErrorDocument 404 /err404.php
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index$|\.php - [L,R=404]
RewriteRule ^([^.?]+)$ %{REQUEST_URI}.php [L]
KYIV CITY ⠀⠀⠀⠀⠀⠀⠀⠀⠀Girl➡️ @s123123⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀#kyiv
@s123123
^[^@\n]+(@\w+)[^\n]+
^\h*\S+\h+(\S+)[^\n]+
preg_replace("/\b".$isUp[$i]."\b/iu",$noUp,$titleNew);
$noUp
нужно $noUp[$i]
$title = 'maximum best program for you - this is a 3d max - super puper program';
$array = array("3D","4K","MAX","PROGRAM");
foreach ($array as $word) {
$title = preg_replace('/\b'.$word.'\b/iu', $word, $title);
}
echo $title; // maximum best PROGRAM for you - this is a 3D MAX - super puper PROGRAM
|
в регулярке (http|https)
When using the regex / not_regex patterns, it may be necessary to specify rules in an array instead of using|
delimiters, especially if the regular expression contains a|
character.
RewriteEngine on
RewriteCond %{ENV:REDIRECT_STATUS} !^$
RewriteRule ^ - [L]
RewriteCond %{QUERY_STRING} (?:^|&)p=(\d+)(?:$|&)
RewriteRule ^ /%1? [R]
RewriteCond %{QUERY_STRING} (?:^|&)category=([^&]+)
RewriteRule ^(\d+)$ /$1/%1? [R]
RewriteRule ^(\d+)$ index\.php?p=$1
RewriteRule ^(\d+)/(.+)$ index\.php?p=$1&category=$2
/index.php?p=123
или /?p=123
перенаправить на /123
/123?category=abc
перенаправить на /123/abc
/123/abc
перенаправить в index.php?p=123&category=abc
There are a couple of things which are not supported yet (like %{REQUEST_FILENAME}) but we hope to add them in the future.
RewriteRule ^(.*)$ https://%{HTTP_HOST}%1/%2%3 [R=301,L]
RewriteCond %{REQUEST_URI} ^(.*)/(2\d{3})(-.*)$
RewriteCond %{TIME_YEAR}_%2 !^(\d+)_\1$
RewriteRule ^ https://%{HTTP_HOST}%1/%{TIME_YEAR}%3 [R=301,L]
Тогда вместо
http://localhost/site/
можно использоватьhttp://site.local/