Answer the question
In order to leave comments, you need to log in
How to set up a 301 redirect in Yii2 for addresses like /catalog/trikotazh?page=1?
The rules in .htaccess
do not seem to be designed for /blog/category?page=1 and never work with such an address (probably because of the characters for regular expressions). addresses...
How to make /blog/category?page=1 become /blog/category
Answer the question
In order to leave comments, you need to log in
Good morning.
Leave .htaccess and query string checking alone)))
Everything is solved much easier.
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => [
'defaultPageSize' => 20,
'forcePageParam' => false,
]
]);
RewriteCond %{QUERY_STRING} .
RewriteCond %{QUERY_STRING} (?:^|&)page=1 [NC]
RewriteRule ^ %{REQUEST_URI}? [R=301,L,NE]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question