I
I
Igor Rakhimov2021-05-03 09:18:59
1C-Bitrix
Igor Rakhimov, 2021-05-03 09:18:59

Why does the browser console give a 404 error on the details page of the news element, although the page itself is displayed correctly?

The situation arose after the placement of the news complex component on the /o-kompanii/novosti-kompanii/ page. After creating the "Company News" IB element and trying to go to its detailed page in the public part, the browser console generates an error 404:

GET https://iterniti24.ru/o-kompanii/novosti-kompanii/... 404
nami-proydena -sertifikatsiya-vgm.html:1

In this case, the page itself is displayed correctly, with the exception of the following moment: being on this detailed page of the element, it is impossible to switch the editing mode in the toolbar to the "on" position (exactly the same as it is impossible to switch back to the " disabled" if it was enabled before switching to it) - the slider returns to its original state.

.

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{ENV:HTTPS} !on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI } [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [R=404, L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]

...

urlrewrite.php
<?php
$arUrlRewrite=array (
0 =>
array (
'CONDITION' => '#^/o-kompanii/ novosti-kompanii/#',
'RULE' =>'',
'ID' => 'bitrix:news',
'PATH' => '/o-kompanii/novosti-kompanii/index.php',
'SORT' => 100,
),
1 =>
array (
'CONDITION' => '#^/uslugi/#',
'RULE' => '',
'ID' => 'bitrix:news',
'PATH' => '/dev/include_areas/banner-uslugi.php',
'SORT' = > 100,
),
);?>

The CNC settings in the IB and the news component are correct.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Rakhimov, 2021-05-04
@irakhimov90

Understood.
If someone has a similar situation, the solution is:
in .htaccess check the correctness of the rule:
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L] - correct
My value was incorrect, namely:
RewriteRule ^(.* )$ /bitrix/urlrewrite.php [R=404,L] - not correct

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question