Post by ShopNet » Sat Mar 20, 2021 10:57 pm

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.
Last edited by ShopNet on Mon Mar 22, 2021 4:40 pm, edited 1 time in total.

Newbie

Posts

Joined
Mon Dec 02, 2019 7:59 am

Post by straightlight » Sun Mar 21, 2021 12:26 am

.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


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ShopNet » Mon Mar 22, 2021 4:40 pm

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']));
   }
}

Newbie

Posts

Joined
Mon Dec 02, 2019 7:59 am
Who is online

Users browsing this forum: No registered users and 52 guests