D
D
Dmitry Bondarchuk2018-10-17 09:01:24
1C-Bitrix
Dmitry Bondarchuk, 2018-10-17 09:01:24

How to display a 404 page if the Bitrix paging parameter is incorrect?

Good afternoon! Maybe a stupid question, but I can't find the answer.
How can I display a 404 error if a person enters the wrong page number in the address bar. Those. there are pages (for example, in a catalog) from 1 to 30, and the user enters the number 55 in the URL. The first page is displayed in Bitrix, and it is required that a 404 error be displayed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Malinovsky, 2018-10-17
@scotch18

By means of Bitrix, this will not work. We'll have to flatter the code and do checks.
And you can call 404 with the following function

\Bitrix\Iblock\Component\Tools::process404("",true,true,true);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question