Answer the question
In order to leave comments, you need to log in
What's wrong with the rewrite rule?
You need this url
http://site.ru/index.php?mode=archive&year=2019&number=2
https://site.ru/ru/archive/2019/2
RewriteEngine on
RewriteCond %{QUERY_STRING} mode=archive
RewriteCond %{QUERY_STRING} year=(\d+)
RewriteCond %{QUERY_STRING} number=(\w+)
RewriteRule .* /ru/archive/%1/%2/? [R=301,L]
https://site.ru/index.php
Answer the question
In order to leave comments, you need to log in
Add to the beginning of the .htaccess file
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{QUERY_STRING} mode=archive
RewriteCond %{QUERY_STRING} ^(?=.*?year=(\d+))(?=.*?number=(\d+))
RewriteRule ^index\.php$ /ru/archive/%1/%2/? [R=301,L]
RewriteCond %{THE_REQUEST} ^\S+\s/index\.php\?(?=.*?mode=archive)(?=.*?year=(\d+))(?=.*?number=(\d+))
RewriteRule ^ /ru/archive/%1/%2/? [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question