Setting up a multi-domain 1C-Bitrix configuration

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
    1189
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    813
  • 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
    657
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

Setting up multi-domain configuration in 1C-Bitrix

Multi-domain configuration — this is when one Bitrix site is accessible through multiple domain names. Not to be confused with multi-site functionality: there different sites (different content, templates), here — one site, multiple entry points. Typical scenarios: example.com and www.example.com, regional domains example.ru / example.by / example.kz with unified content, or migration from old domain to new with both working.

The problem that multi-domain setup solves

Without proper setup, Bitrix accessing via "unknown" domain either gives 404 or works with errors: links generated with wrong domain, authorization fails due to cookie domain mismatch, sitemap contains old domain URL, and canonical points wrong. Each of these issues hurts SEO and user experience.

Setup at Bitrix level

Main domain is set in site settings: Settings → Product settings → Sites → SERVER_NAME field. This is the domain Bitrix uses to generate absolute URLs — in emails, sitemap, og:url etc.

Additional domains Bitrix doesn't store by itself. The system determines site by SERVER_NAME from HTTP header Host. If incoming Host doesn't match any site — default site is selected. This works, but without explicit control.

For explicit management use urlrewrite.php or init.php file:

// /local/php_interface/init.php
$host = $_SERVER['HTTP_HOST'] ?? '';
$domainMap = [
    'example.ru'     => 's1',
    'example.by'     => 's1',
    'example.kz'     => 's1',
    'www.example.ru' => 's1',
];
if (isset($domainMap[$host])) {
    define('SITE_ID', $domainMap[$host]);
}

Setup at web server level

Each domain needs a separate server block (nginx) or VirtualHost (Apache), pointing to same DOCUMENT_ROOT.

Nginx:

server {
    server_name example.ru example.by example.kz www.example.ru;
    root /home/bitrix/www;
    include /etc/nginx/conf.d/bitrix.conf;
}

Redirects — mandatory. Without canonical redirect, search engines index duplicates. Standard scheme:

  • www.example.ru → 301 → example.ru (or vice versa — choose one variant)
  • http:// → 301 → https://
  • Regional domains — either 301 to main, or hreflang markup

SSL certificates

Each domain requires valid SSL. Options:

  • Wildcard certificate *.example.ru — covers subdomains, but not example.by
  • SAN certificate (Subject Alternative Name) — one certificate for multiple domains. Let's Encrypt supports up to 100 SAN via certbot --domains example.ru,example.by,example.kz
  • Separate certificates — if domains are in different zones, easier to manage

Cookie and authorization

Critical point: PHPSESSID cookie and Bitrix authorization cookies (BITRIX_SM_LOGIN, BITRIX_SM_UIDH) are bound to domain. User authorized on example.ru won't be authorized on example.by.

If you need cross-domain authorization — this is separate task solved via SSO module or token mechanism with redirect. For most multi-domain configurations (redirect / mirrors) this isn't needed — 301 to canonical domain is sufficient.

Checklist after setup

  • SERVER_NAME in site settings matches main domain
  • All non-main domains have 301 redirect to canonical
  • SSL valid for all domains
  • canonical on pages points to main domain
  • Sitemap contains URLs only of main domain
  • Mail notifications contain correct links (check with test order)

Setup takes about one working day, including web server configuration and redirect testing.