Answer the question
In order to leave comments, you need to log in
How to use wildcards in htaccess?
Hello!
You need to write a redirect for the pagination pages of two categories. I want to write a universal version.
View redirect:
/articles/?start=10 => /articles/?page=1
/vse-novosti/?start=10 => /vse-novosti/?page=1
RewriteCond %{REQUEST_URI} ^/(articles|vse-novosti)/$ [NC]
RewriteCond %{QUERY_STRING} start=([0-9])([0-9]) [NC]
RewriteRule .* /%1/?page=%2 [R=301,L] # рассчитываем на /articles/?page=1
Answer the question
In order to leave comments, you need to log in
The documentation says:
These are backreferences of the form %N (0 <= N <= 9). %1 to %9 provide access to the grouped parts (again, in parentheses) of the pattern, from the last matched RewriteCond in the current set of conditions
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question