For SEO purposes I need to remove the first page number from the URL. i.e I have the following:
example.com/pages/view the two URLs points to the same contents of the view action. I want to make the pagination free from
1 in the URL. i.e first Page link and Page Number 1 should be linked to
I tried to deal with the $pagination object like the following:
$pages = new Pagination(['totalCount' => $books['booksCount'], 'pageParam' => 'start', 'defaultPageSize' => 10,]); $pagingLinks = $pages->getLinks(); $pagingLinks['first'] = '/'; $pages->links = $pagingLinks;
However, the last line causing error:
Setting read-only property: yii\data\Pagination::links
So I have a problem to modify the links property. Is there any other solution to get this task done?!