Answer the question
In order to leave comments, you need to log in
What's wrong with RewriteRule (internal redirect not working)
The site has a page with the address
/car_sets/search?search_category=car_sets&category=auto&make=BMW
/mashinokomplekt-bmw
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
</IfModule>
<IfModule mod_rewrite.c>
#Запрет на просмотр директорий
Options All -Indexes
#редирект с www на без www
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
#редирект с index.php на без
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ / [R=301,L]
#убираем последний слэш
RewriteRule ^(.*)/$ $1 [R=301,L]
RewriteRule ^mashinokomplekt-bmw? car_sets/search?search_category=car_sets&category=auto&make=BMW [L]
#условие, что все существующие папки не будут обрабатываться регулярным выражением
RewriteCond %{REQUEST_FILENAME} !-f
#условие, что все существующие файлы не будут обрабатываться регулярным выражением
RewriteCond %{REQUEST_FILENAME} !-d
#регулярное выражение, в нашем случае — при любой строке запроса будет открывать index.php,
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
AddDefaultCharset UTF-8
php_value max_execution_time 0
RewriteRule ^mashinokomplekt-bmw? car_sets/search?search_category=car_sets&category=auto&make=BMW [R=301,L]
Answer the question
In order to leave comments, you need to log in
If you have access to the host settings, then you can try to enable logging for mod_rewrite. There are two different options for two branches of Apache, as I understand it. Well, from the logs it will already be easier to understand how a particular url is processed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question