E
E
Evgeny Shevtsov2015-05-28 16:55:07
Nginx
Evgeny Shevtsov, 2015-05-28 16:55:07

How to correctly set the rewrite rule?

There is a link like
domen.ru/?xxx=zzz&a=123
And the only thing that changes in this link is the last digits.
How can I change the rules through rewarite to something like:
domen.ru/qqq=123 ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ShamblerR, 2015-06-01
@ShamblerR

a question the answer.

# 301 --- http://домен.ру/?xxx=zzz&a=123 => http://домен.ру/qqq=123
RewriteCond %{QUERY_STRING} (^|&)xxx=zzz($|&)
RewriteCond %{QUERY_STRING} (^|&)a=123($|&)
RewriteRule ^$ /qqq=123? [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question