(?:.*?\K symbol ){N}(?:.*?\K\.){3}\K https://regex101.com/r/A7aQ0I/2((?:.*?\.){2}.*?)\.$1 (ЗАМЕНА) Require expr "req_novary('CF-Connecting-IP') -ipmatch '1.2.3.0/24' "
Require expr "req_novary('CF-Connecting-IP') -ipmatch '7.7.7.7' "RewriteEngine On
RewriteCond %{HTTP:CF-Connecting-IP} !^1\.2\.3
RewriteCond %{HTTP:CF-Connecting-IP} !=7.7.7.7
RewriteRule ^ - [R=403,L] location /wp {
root /var/www/mysite;
try_files $uri /wp/index.php?args;
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
}
} ## Begin - Joomla! core SEF Section. # RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] # # If the requested path and file is not /index.php and the request # has not already been internally rewritten to the index.php script # and the request is for something within the component folder, # or for the site root, or for an extensionless URL, or the # requested URL ends with one of the listed extensions RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{SERVER_PORT} !^443$ должно стоять над RewriteRule .* https://RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]RewriteCond %{SERVER_PORT} !^443$RewriteCond %{HTTP:Front-End-Https} !on Это работает, но редирект идет на корень сайта, а не на эту же страницу в нижнем регистре.
${lowercase:$1} не работает и возвращает пустую строку, а не строку в нижнем регистре.RewriteMap lowercase int:tolower в настройках <VirtualHost> RewriteRule .* index.php.* совпадает с любой строкой, так что запрос /event/test.php будет перенаправлен на index.php в корне сайта.RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-proto} !^https$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]И еще в этой же папке лежит скрипт php который запускается через cron и всё прекрасно работает.
RedirectMatch 301 ^/category/ /RewriteEngine on
RewriteRule ^category/ / [R=301,L] $html = preg_replace('~<img[^>]*src="([^"]+)"[^>]*>|<a\b.+?</a>(*SKIP)(*F)~is', '<a href="$1">$0</a>', $html); (^|,)(?i:[а-яё]()|[^,])++(?!\2)(?:(^|,)(?i:[а-яё]()|[^,])*+(?!\2))+,? создал физическую папку, в нем разместил index.php - выходит циклический редирект
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [R=301,L]DirectorySlash Off, но тогда нужны дополнительные правила, чтобы при обращении к существующей папке работал размещённый в ней index.php.ErrorDocument 403 "<!DOCTYPE html><html><head></head><body></body></html>"
RewriteEngine on
RewriteCond %{http_Referer} !^https?://(www\.)?(site\.ru|(yandex|google)\.\w+)/
RewriteCond %{http:From} !(googlebot|yandex)
RewriteRule ^ - [R=403,L]map $args $_at {
default "@";
"" "";
}
server {
location ~ ^(.+)\.html$ {
return 301 $1$is_args$args;
}
location / {
try_files $uri $uri$_at$args.html $uri/ /index.php?$args;
}