Answer the question
In order to leave comments, you need to log in
How to configure the CNC in the bitrix.news component?
Hello.
Problem: with the CNC turned on, the text of the news is not displayed on the detailed view page of the news.
To display news, I use the bitrix.news complex component.
The list of news is displayed at: bitrix-biz.com/novosti
With the CNC turned off, the link to the news in detail looks like: http://bitrix-biz.com/novosti/?ELEMENT_ID=%ID%
where %ID% is the news identifier.
With the CNC turned on, the link to the news in detail looks like: http://bitrix-biz.net/novosti/%ID%/
where %ID% is the news identifier.
Infoblock settings:
CNC component settings:
urlrewrite.php in the root of the news site there is the following entry:
array (
'CONDITION' => '#^/novosti/#',
'RULE' => '',
'ID' => 'bitrix:news',
'PATH' => '/novosti/index.php',
'SORT' => 100,
)
Options +Indexes
ErrorDocument 404 /404.php
<IfModule mod_php5.c>
php_flag session.use_trans_sid off
php_value display_errors 1
php_value mbstring.func_overload 2
php_value mbstring.internal_encoding UTF-8
php_value max_input_vars 10000
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_REFERER} http://bot.net/
RewriteRule .* http://bitrix-biz.net [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php [L,QSA]
</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>
Answer the question
In order to leave comments, you need to log in
check if .htaccess works and if there are conditions for mod_rewrite in it
remove section
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_REFERER} bot.net
RewriteRule .* bitrix-biz.net [R=301,L]
RewriteCond %{REQUEST_FILENAME} !- f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php [L,QSA]
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