G
G
Greg Plitt2020-03-02 13:46:13
htaccess
Greg Plitt, 2020-03-02 13:46:13

Why doesn't 301 redirect work from page to page?

Tell me why the 301 redirect does not work and what needs to be done for this?
If the pages are static or a redirect from static to ?page=2 then it works, but when such conditions, then nothing happens at all. How to be?

RewriteCond %{REQUEST_URI} /mebel/komod-arlen-8?page=18$
RewriteRule ^(.*)$ https://******.ru/rossiya/komod-arlen-8?page=2 [ R=301,L]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-03-02
@bit24yes

GET parameters should be looked for in the %{QUERY_STRING} variable.

RewriteCond %{QUERY_STRING} (^|&)page=18($|&)
RewriteCond %{REQUEST_URI}  ^/mebel/komod-arlen-8$
RewriteRule ^(.*)$ https://site.ru/rossiya/komod-arlen-8?page=2 [R=301,L]

Or
RewriteCond %{QUERY_STRING} (^|&)page=18($|&)
RewriteRule ^mebel/komod-arlen-8$ https://site.ru/rossiya/komod-arlen-8?page=2 [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question