E
E
Eugene2017-10-10 10:49:00
htaccess
Eugene, 2017-10-10 10:49:00

How to redirect page=1 to without it?

I have 2 codes and both of them fail in that they redirect ?page=15 to ?5
#RewriteCond %{QUERY_STRING} ^(.*)&?page=1(.*)$
#RewriteRule ^(.*)/ ?$ /$1?%1%2 [R=301,L]
RewriteCond %{QUERY_STRING} ^page=1$
RewriteRule (.*) $1? [L,R=301]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2017-10-10
@eugeneledenev

RewriteCond %{QUERY_STRING} ^page=1$
RewriteRule (.*) $1? [L,R=301]
This variant works correctly!!!
My experiment failed because of the cache.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question