Answer the question
In order to leave comments, you need to log in
How to configure the CNC so that invalid links return a 404 response?
The site has a page /info/stock/index.php. It has a list of stocks in the bitrix:news component. There is a rule in urlrewrite.php - 'CONDITION' => '#^/info/stock/#' .
As a result, both the list and details of the stock are displayed correctly on the site, for example, at /info/stock/fevral/. But links like /info/stock/fevral/abcd123/ also work - they give a page with a list of stocks.
How can I configure the processing of only correct links, and the rest 404?
The fact that such /info/stock/fevral/abcd123/ links are shown is a Bitrix bug or is everything ok?
Answer the question
In order to leave comments, you need to log in
configure the 404th page through unit.php (there are many options on the internet)
through define("ERROR_404"), after pre-writing the condition on defined('ERROR_404') in the function in init.php, you can go to the 404th anywhere
in In the component, write the condition that if there are no results for stocks, then @define("ERROR_404")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question