Hello.

There are addresses of the form:

http://site.ru/articles/news?page=N

where N is the page in the section, i.e. any number from 1 to infinity!

These addresses need to be redirected to the address of the form:

http://site.ru/news/page/N

I try this:

# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} page=(.*)$ [NC] RewriteRule ^articles/news /news/page/%1 [R=301,L] 

not working, what's wrong?

  • Redirect stupidly throws on site.ru/news without / page / N at the end of the address - Enshtein

2 answers 2

 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} page=(\d+) [NC] RewriteRule .* /page/%1/? [R=301,L] 

here is the solution to the problem:

 RewriteCond %{QUERY_STRING} page=(\d+) [NC] RewriteRule ^articles/news /news/page/%1? [R=301,L]