Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule (.*)\.html$ https://domain.ru/$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !sitemap\.xml$
RewriteRule ^(.*[^/])$ https://domain.ru/$1/ [L,R=301]
RewriteCond %{HTTP:PORT} !^443$ [OR]
RewriteCond %{HTTP_HOST} !^domain\.ru [NC]
RewriteRule (.*) https://domain.ru/$1 [R=301,L]
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] RewriteRule ^(.*)$ /public/$1RewriteRule ^(.*)$ public/$1RewriteCond %{REQUEST_FILENAME} !-f # не файл RewriteCond %{REQUEST_FILENAME} !-d # не папка
# не файл
RewriteCond %{REQUEST_FILENAME} !-f
# не папка
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/user/plugins/fred/elFinder-2\.1\.50 RewriteCond %{THE_REQUEST} " /current/public/(\S*)"
RewriteRule ^ https://%{HTTP_HOST}/%1 [R=301,L,NE] RewriteCond %{HTTP_HOST} ^(www\.|)oldsite\.ru$ [NC]
RewriteRule ^(category1|category2)/.* http://newsite.ru/$0 [R=301,L]
RewriteCond %{HTTP_HOST} ^(www\.|)oldsite\.ru$ [NC]
RewriteRule ^ http://newsite.ru/ [R=301,L] RewriteRule ^news/(sport)$ /pages/news.phpRewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteRule ^news/(sport)$ /pages/news.php?type=sport [L] RewriteRule ^uslugi/new_usluga/$ /folder/index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L][OR] можно обойти проверку существования папки RewriteCond %{REQUEST_FILENAME} !-d.RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/uslugi/ [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]DirectoryIndex сделает свое дело и при запросе существующей папки /uslugi/new_usluga/ будет вызван /uslugi/new_usluga/index.php. Остальные запросы, как и прежде, обработает index.php в корне сайта. 2. При написании редиректа с главной страницы rukartina.ru перенаправляет на несуществующую страницу https://rakovgallery.ru/index.php
В чем проблема?
RewriteRule ^(.*)$ index.php, поэтому редиректы нужно добавлять в начало файла, чтобы они срабатывали раньше, чем другие правила.RewriteEngine On RewriteCond %{REQUEST_FILENAME} robots.txt$ [NC] RewriteRule ^([^/]+) $1 [L] RewriteCond %{HTTP_HOST} ^www.rukartina\.ru$ [NC] RewriteRule ^(.*)$ https://rakovgallery.ru/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^rukartina\.ru RewriteRule ^(.*)$ https://rakovgallery.ru/$1 [R=301,L]
RewriteEngine On
RewriteCond %{THE_REQUEST} "! /robots\.txt"
RewriteCond %{HTTP_HOST} ^(www\.|)rukartina\.ru$ [NC]
RewriteRule ^(.*)$ https://rakovgallery.ru/$1 [R=301,L] ## 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>