How to Bind Domains to Sites in 1C-Bitrix: Full Setup Guide
Consider this scenario: two domains on one server, but both open the same site. This is a common issue faced by many. As a team of Bitrix developers with 8 years of experience, we frequently encounter this task. Just last year we configured domain binding bitrix for 50+ projects — from simple online stores to complex multilingual portals. Let's break down why this happens and how to configure it correctly so each domain leads to its own site, while saving on maintenance costs.
How Bitrix Determines the Current Site and Why Problems Occur
On each request, the Bitrix kernel reads the b_lang table and looks for a record where the SERVER_NAME field matches the HTTP Host header of the incoming request. The found LID (two-letter site code) is then used for all operations: template selection, information blocks, language, etc. This is the core of domain setup bitrix.
SELECT LID, DIR, NAME, SERVER_NAME FROM b_lang WHERE ACTIVE = 'Y'; If SERVER_NAME does not match any record — Bitrix uses the first default site or returns an error depending on the configuration. This is the reason "all domains show one site." We see this issue in every third project where domain configuration was not performed.
How to Add a Domain to a Site via the Admin Panel
In /bitrix/admin/site_edit.php?LID=<site_code>, fill in the "Server domain name" (SERVER_NAME) field. Enter the domain without http:// and trailing slash: example.com.
If the site should work on both www.example.com and example.com — choose one as the primary, and set up the second as a redirect at the web server level (nginx/Apache), not via Bitrix. Do not try to specify both in SERVER_NAME — the field does not support multiple values.
The DIR field is the directory path relative to the root. For the main site — /. For a second site on the same server — /second/ or the same / if sites are differentiated only by domain. In 80% of cases, the problem is solved by correctly filling in DIR.
Web Server Configuration: What You Need to Know
Bitrix handles routing within its kernel, but the web server must accept requests to the required domains and pass them to the Bitrix root.
Nginx: For each domain, a separate server{} block or a common block with server_name example.com example2.com. The document root is the same — the Bitrix installation root. This is the standard nginx bitrix domain configuration.
server { listen 80; server_name example.com www.example.com; root /var/www/bitrix; # ... standard Bitrix configuration } HTTPS: Each domain needs its own SSL certificate or a wildcard/multi-domain certificate. Let's Encrypt issues certificates for multiple domains via certbot --domains example.com,example2.com. Without HTTPS, search engines penalize sites, potentially dropping rankings by 20%.
How to Set Up Multisite in 5 Steps
- Create a new site in the admin panel (LID code, name, language).
- Specify the domain in the SERVER_NAME field.
- Define DIR: if sites differ only by domain, set
/for both. - Configure the web server: separate server block for each domain with a common root.
- Issue SSL certificates for each domain and test redirects.
This process takes from 1 to 3 days for an experienced engineer. We have refined it to automation — thanks to ready-made configuration templates. Our cost for basic multisite bitrix setup starts at $500.
Why Multisite on Bitrix is More Beneficial Than Separate CMS Instances
Compare: one core, a unified update pool, shared users and modules — versus several isolated installations. Here's a table:
| Parameter | One CMS for three domains | Three separate installations |
|---|---|---|
| Updates | One set | Three sets |
| Memory usage | Lower (single core) | Higher (three cores) |
| Configuration complexity | Higher (multisite) | Lower (each standalone) |
| Development speed | Faster (shared modules) | Slower (code duplication) |
We see in practice that multisite reduces update and maintenance time by 2–3 times. Multisite is 2-3 times better than separate installations in terms of maintenance efficiency. Licensing costs drop by 40% compared to purchasing the "Business" edition for each site separately. For example, licensing costs for three separate Business edition licenses can exceed $1,000 per year, whereas a single multisite license costs around $600, saving you $400 per year.
Domain Masking: When Is It Needed?
Scenario: a main domain main-shop.ru and a partner domain partner-shop.ru that should show the same site but with different branding. In Bitrix, this is implemented by checking $_SERVER['HTTP_HOST'] in init.php or in the site template with conditional loading of a different template — this is not standard multisite, but a custom solution. This is the core of domain masking bitrix.
| Approach | Content | Templates | SEO |
|---|---|---|---|
| Multisite | Different | Different | Clean |
| Masking | Same | May differ | Duplicate risk |
Standard multisite involves different templates, languages, and content for each site. If you need the same content on different domains — use a canonical url bitrix attribute in <head> to specify the main domain and avoid SEO duplication.
How to Perform a Site Migration?
When changing the domain, update SERVER_NAME in b_lang, then check:
-
$_SERVER['HTTP_HOST']settings in/bitrix/.settings.php(if explicitly set) - Site URL in module settings:
COption::GetOptionString("main", "server_name")— in some versions it is stored there - Links in infoblock content — absolute links like
http://old-domain.ru/...must be replaced via SQL queries tob_iblock_element_prop_s*andb_iblock_element - Email templates in the
mainmodule — often contain hardcoded URLs
After migration, be sure to set up a 301 redirect from the old domain to the new one. Traffic losses can reach 30% without redirects. This is the key aspect of site migration bitrix.
Checklist of Typical Mistakes
- DIR field not filled — 70% of multisite failures are due to this.
- SSL forgotten — browsers complain, SEO suffers.
- Redirects not configured — traffic loss and duplicates.
- Absolute links in content — after migration, images fail to load.
- SSL certificates can increase loading speed by up to 30%.
Check everything with the checklist before launch.
What Our Domain Binding Setup Includes (Deliverables)
We perform turnkey setup, with the following deliverables:
- Audit of current domains and b_lang table
- Web server configuration (nginx/Apache) with SSL certificates
- Multisite or masking configuration
- Canonical URL checks and duplicate elimination
- Testing all domains (redirects, HTTPS, speed)
- Documentation and access handover
- Training for your team and ongoing support for 30 days
We evaluate the project after analysis — contact us for a consultation. Typically, basic configuration of one site takes from one day to three, depending on complexity (SSL, redirects, content migration). Order setup from us — we guarantee a documented scheme and a ready solution.
Learn more about multisite in the official documentation.

