Answer the question
In order to leave comments, you need to log in
How to make a redirect in .htaccess to a partially different url?
Help me write an expression for redirecting pages of the form:
http://site.ru/text-01-mart-2020
to url with a different date and month:
http://site.ru/text-02-aprel-2020
Where text is any text in Latin.
Answer the question
In order to leave comments, you need to log in
RewriteRule ^(.+)\-01\-mart\-2020$ /$1\-02\-aprel\-2020? [L,R=301]
.+
- 1 or more characters (..)
- just brackets collect everything in the variable $1 if there were second brackets, then they would be $2, ?
in the end it will remove all get parameters if they were there
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question