Hi Guys,
I use opencart 3.0.2.0 and default theme on my website. In the categories on my site, 30 products are published on each page. The category with 90 products is published on 3 pages, but google indexes the 4th, 5th, 6th pages that are not on my site.
I don't know where and how google indexed it, also gives an error because it cannot find these non-existent pages. The non-existent pages need to be redirected to either the 404 page or the first page of that category.
Example:
This page is not available on my site. -> https://demo.opencart.com/index.php?rou ... =20&page=2 -> &page=2
I need to redirect to this page. -> https://demo.opencart.com/index.php?rou ... ry&path=20
Would you please help me.
Many thanks.
.htaccess issues. Not a bug.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
i fixed
Code: Select all
catalog/controller/product/category.php
//before
$data['sort'] = $sort;
//add
if(isset($this->request->get['page'])){
$get__page = $this->request->get['page'];
$total__page = ceil($product_total/$limit);
if($get__page > $total__page){
$this->response->redirect($this->url->link('product/category', 'path=' . $category_info['category_id']));
}
}
Who is online
Users browsing this forum: No registered users and 263 guests