K
K
kentos2018-11-14 19:38:32
1C-Bitrix
kentos, 2018-11-14 19:38:32

How to automate urlrewrite?

Hello, how to optimize urlrewrite so that I add a country through the admin panel? and automatically registered in urlrewrite

array(
        "CONDITION" => "#^/khorvatiya|marokko|tanzaniya|izrail|gretsiya|egipet|bolgariya|vetnam|ispaniya|italiya|kipr|kitay|litva|maldivy|oae|kuba|filippiny|chernogoriya|shri-lanka|avstriya|portugaliya|albaniya|belgiya|vengriya|germaniya|gruziya|dominikana|indiya|indoneziya|indoneziya|latviya|likhtenshteyn|mavrikiy|malayziya|niderlandy|polsha|russia|seyshelskie-ostrova|sloveniya|tailand|tunis|turtsiya|uzbekistan|ukraina|finlyandiya|frantsiya|chekhiya|shveytsariya|shvetsiya|estoniya|belarus|yaponiya/#",
        "RULE" => "",
        "ID" => "bitrix:catalog",
        "PATH" => "/strany/country.php",
    ),

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Gritsuk, 2018-11-14
@winer

You need to correctly configure the CNC of the bitrix:catalog
component, for example, the component parameters for such a CNC will be:
"SHOW_404" => "Y",
"SEF_MODE" => "Y",
"SEF_FOLDER" => "/",
"SEF_URL_TEMPLATES" => array(
"sections" => "",
"section" => "#SECTION_CODE_PATH #/",
"element" => "#SECTION_CODE_PATH#/#ELEMENT_CODE#/",
"compare" => "compare/",
"smart_filter" => "#SECTION_CODE_PATH#/filter/#SMART_FILTER_PATH#/apply/",
)
and in urlrewrite:
array (
'CONDITION' => '#^/#',
'RULE' => '',
'ID' => 'bitrix:catalog',
'PATH' => '/strany/index.php',
'SORT' => 100,
),
Pay attention to the SHOW_404 parameter. Without it, 404 will not work properly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question