Answer the question
In order to leave comments, you need to log in
How to fix mod_rewrite?
Good day
A rule is configured in .htaccess,
RewriteEngine on
RewriteCond %{REQUEST_URI} (^.)+
RewriteCond %{HTTP_COOKIE} CITY=([^;]+) [NC]
RewriteRule ^(.*)$ /%1/$1 [L,R=301]
Answer the question
In order to leave comments, you need to log in
%1 is part of the url ? or is it a variable from rewritecond ?
if it's just a url then somewhere like that ?
RewriteCond %{REQUEST_URI} ^(.*)/dir1/(.*)$
# если строка содержит /dir1/
RewriteRule ^(.*)$ %1/dir2/%2 [R=301,L]
#Перенаправить все урлы с начинающиеся с dir1 на dir2 с сохранением дальнейшей структуры URL
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question