There is a site with more than 10 pages of type: /ru/pp/rubric/yyyy/mm/dd.html you need to redirect to url like: / arhiv / rubric / yyyy-mm-dd As far as I understand, it is advisable to do it in .htaccess . Please tell me how to properly formulate a regular expression for the redirect, or maybe some other options, how to do this. PS wordpress

    1 answer 1

    In the .htaccess file immediately after

     RewriteEngine On 

    add new line with rule

     RewriteRule ^ru/pp/rubric/(\d{4})/(\d{2})/(\d{2}).html$ arhiv/rubric/$1-$2-$3 [R=301,L,QSA] 

    or

     RewriteRule ^ru/pp/rubric/(\d{4})/(\d{2})/(\d{2}).html$ arhiv/rubric/$1-$2-$3? [R=301,L] 

    if get parameters are not required to be passed with redirect.