I
I
Ivan Ilyasov2021-04-25 18:33:20
Apache HTTP Server
Ivan Ilyasov, 2021-04-25 18:33:20

How to set up a redirect for pagination on a website using .htaccess?

The bottom line is that you need to redirect from the old site to the new one. And the pagination links don't match.

Example: :
http://site/parentcat/cat/?page=3
Need to redirect to http://site/parentcat/cat?p=3

That is, in essence, you need to remove the slash and replace the word page while keeping the page number unchanged.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2021-04-25
@IvanIlyasov

RewriteCond %{QUERY_STRING} (?:^|&)page=(\d+)
RewriteRule ^(.+)/$ http://site/$1?p=%1 [R=301,L]

Put at the beginning of the file immediately after RewriteEngine on

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question