Setting up URL generation for 1C-Bitrix sections and elements

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1177
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

URL Generation Configuration for Sections and Elements in 1C-Bitrix

Ugly URLs like /bitrix/components/bitrix/catalog/detail.php?ID=123 or /catalog/index.php?SECTION_ID=45 result from components running without SEF mode (friendly URLs). Configuring URL generation for infoblock sections and elements is one of the first tasks when launching a catalog.

SEF Mode and URL Templates

In Bitrix, "human-readable URLs" are implemented through the SEF (Search Engine Friendly) mode of the component. In SEF mode, the component manages URL routing through rules.

In the bitrix:catalog component parameters (or bitrix:iblock.list), SEF settings are:

$APPLICATION->IncludeComponent('bitrix:catalog', '', [
    'SEF_MODE'   => 'Y',
    'SEF_FOLDER' => '/catalog/', // folder where the component operates
    'SEF_URL_TEMPLATES' => [
        'list'    => '',                    // /catalog/
        'section' => '#SECTION_CODE#/',     // /catalog/shoes/
        'element' => '#SECTION_CODE#/#ELEMENT_CODE#/', // /catalog/shoes/sneakers/
    ],
]);

Variables in URL Templates

Available variables for templates:

Variable Description Source
#ELEMENT_ID# Element ID b_iblock_element.ID
#ELEMENT_CODE# Symbolic code b_iblock_element.CODE
#SECTION_ID# Section ID b_iblock_section.ID
#SECTION_CODE# Section symbolic code b_iblock_section.CODE
#IBLOCK_TYPE_ID# Infoblock type b_iblock.IBLOCK_TYPE_ID
#IBLOCK_CODE# Infoblock symbolic code b_iblock.CODE

URL Configuration in Infoblock Settings

Besides component parameters, URL templates are set in infoblock settings:

Content → Infoblocks → [infoblock] → Settings:

  • Detail page URL — template for DETAIL_PAGE_URL
  • List page URL — template for LIST_PAGE_URL
  • Section page URL — template for SECTION_PAGE_URL

Example: /catalog/#SECTION_CODE#/#ELEMENT_CODE#/

These values are stored in b_iblock.DETAIL_PAGE_URL, b_iblock.SECTION_PAGE_URL and used by CIBlockElement::GetDetailPageUrl methods.

Symbolic Code Generation

The symbolic code (CODE) is important for URLs. Without it, the URL will contain #ELEMENT_ID#. Configure automatic code generation:

Content → Infoblocks → [infoblock] → Fields → Symbolic code:

  • Transliterate from — select a field (usually "Name")
  • Unique — enable to append suffix on duplication
  • Maximum length — recommended 100 characters

When editing an element, the code is generated automatically. For existing elements without code — bulk fill via admin panel (Select all → Set symbolic code).

URL Redirect Rules on Change

When changing an element's symbolic code, the old URL stops working. For SEO, configure 301 redirects. Options:

  • seo module → "URL for 301 redirects" — stores element URL history in b_seo_url_rewrite
  • Handler OnBeforeIBlockElementUpdate — intercept code change and create redirect rule
  • Manual addition via Settings → URL redirects

SEF and Friendly URLs for Trade Offers (SKU)

For stores with trade offers, the URL is built from the main product. SKU selection via GET parameter (?sku=123) or via JavaScript when selecting characteristics. Specific SKU typically has no separate URL.

Execution Timeline

Configuring SEF mode, URL templates, and bulk symbolic code generation — 3–5 hours. Configuring 301 redirects for existing elements when changing URL structure — 2–4 hours additional.