A
A
Alexander Kovalenko2021-11-10 11:22:54
opencart
Alexander Kovalenko, 2021-11-10 11:22:54

Why are "?page=" pages generated with a minus sign?

Hello. The question is how to remove the generation of pages with a minus sign. They can be generated indefinitely.
Example: https://echo-nvrsk.ru/vita.html?page=-777 (you can substitute any number)
Yandex is nervous about this.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
opencartbot, 2021-11-15
@opencartbot

Hello. There is such a thing, it is solved with a file in the controller.
For example, for categories in catalog/controller/product/category.php
, just before the line:
$data['heading_title'] = $category_info['name'];
add a page number check and redirect to the first page of the category:

if ($page < 1) {
  $this->response->redirect($this->url->link('product/category', 'path=' . $category_info['category_id']));
}

V
VVCh, 2021-11-21
@VVCh

It is better to check not $page
but this->request->get['page']
there may be 1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question