Answer the question
In order to leave comments, you need to log in
How can I set up the CNC in the bitrix.news component?
Good evening or afternoon)
Problem: with the CNC turned on, the text of the news is not displayed on the detailed view page of the news. Goes to the main page, although it writes the address of a non-main page in the URL.
To display news, I use the bitrix.news complex component.
The list of news is displayed at: /article/index.php Infoblock
settings:
CNC component settings:
urlrewrite.php in the root of the news site there is the following entry:
5 =>
array (
'CONDITION' => '#^/article/#',
'RULE' => '',
'ID' => 'bitrix:news',
'PATH' => '/article/index.php',
'SORT' => 100,
),
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Answer the question
In order to leave comments, you need to log in
URL страницы информационного блока: /article/index.php
URL страницы раздела: пусто
URL страницы детального просмотра: /article/#ELEMENT_CODE#/
Управление адресами страниц: /article/
Страница детального просмотра: #ELEMENT_CODE#/
Включить поддержку ЧПУ: Да
Остальное пусто
13 =>
array (
'CONDITION' => '#^/article/#',
'RULE' => '',
'ID' => 'bitrix:news',
'PATH' => '/article/index.php',
'SORT' => 100,
),
Options -Indexes
ErrorDocument 404 /404.php
php_flag session.use_trans_sid off
#php_flag default_charset UTF-8
#php_value display_errors 1
<IfModule mod_php7.c>
php_flag session.use_trans_sid off
#php_flag default_charset UTF-8
#php_value display_errors 1
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day"
ExpiresByType image/png "access plus 3 day"
ExpiresByType text/css "access plus 3 day"
ExpiresByType application/javascript "access plus 3 day"
</IfModule>
here is a complete instruction for setting up the CNC in Bitrix
If in the section with a complex component Bitrix tells you that there is no page, you may have the following error:
The CNC is configured to work with character codes, but they are not filled in
Different CNC settings in the parameters of the component and infoblock.
Record not created in urlrewrite.php
Broke .htaccess
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question