G
G
get312021-03-04 17:19:33
htaccess
get31, 2021-03-04 17:19:33

Htaccess redirect from get request?

Good afternoon.
Please tell me how to make a redirect from:
site.com/?lang=ru to site.com/ru /
and so that when you go to any page (for example, a category) it would be:
site.com/ru/zhenschinam and not site.com /zhenschinam

Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2021-03-04
@shambler81

immediately to you in any language and any URL

RewriteCond %{QUERY_STRING} (?:^|&)lang\=(.+)(?:$|&)
RewriteRule ^(.*)$ /%1/$1? [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question