## 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;
}
RewriteRule ^/api/v1/(\w+)$ /web/api/v1/$1.php [L,NC]
Первому RewriteRule передается путь от того места, где находится .htaccess, до запрошенного файла. Эта строка никогда не начинается со "/".
^/api
на ^api