CityHost.UA
Help and support

How to configure HTTPS for 1C-Bitrix

 4184
21.04.2020
article

Setting up https for 1C-Bitrix is easy. Standard templates usually use relative links (the protocol and even the domain of the site are not specified).

And this eliminates the need to make drastic changes. All you need is to buy and install an SSL certificate , and then recheck everything. And if necessary, make small corrections.

Recommendations for setting up

Before setting up https for 1C-Bitrix, you need to know what links are. There are 4 types in total. The first is relative (/ blog /). There are also 3 types of absolute links:

  • with the relative protocol (sait.ua/blog/);
  • with https protocol (https://sait.ua/blog/);
  • with the http protocol (http://sait.ua/blog/)/.

It is necessary to get rid of the latter. It is because of them that mixed content errors occur.

Now you can configure https for 1C-Bitrix. For this you need :

  1. Make sure that the contact forms on the web resource are functional. Periodically in ajax requests there are absolute links that send data. They will become inactive if you do not replace them with https links.
  2. Check unloading at Rozetka and other sites. Often, the protocol is strictly prescribed in the download scripts. And here you will have to re-generate all the download files. To do this, you need to select the following items: Job. table – Store – Settings – Data export. And then put a check mark in the box "Use https protocol in Yandex download in download".
  3. Configure user redirection to https.

The last point is implemented through .htaccess in several ways :

RewriteEngine on

RewriteCond% {HTTPS}! = On

RewriteRule ^ (. *) $ Https://% {HTTP_HOST} / $ 1 [R = 301, L]

RewriteEngine On

RewriteCond% {SERVER_PORT}! ^ $443

RewriteRule. * Https://%{SERVER_NAME}%{REQUEST_URI} [R = 301, L]

RewriteEngine On

RewriteCond% {HTTPS} off

RewriteCond% {HTTP: X-Forwarded-Proto}! Https

RewriteRule ^ (. *) $ Https://% {HTTP_HOST} % {REQUEST_URI} [L, R = 301]

RewriteCond% {ENV: HTTPS}! He

RewriteRule ^ (. *) $ Https://% {HTTP_HOST} % {REQUEST_URI} [L, R = 301]

RewriteCond% {HTTP: X-HTTPS}! 1

RewriteRule ^ (. *) $ Https://% {HTTP_HOST} / $ 1 [R = 301, L]

RewriteEngine On

RewriteCond% {HTTP: SSL}! 1

RewriteRule (.*) Https://%{HTTP_HOST}%{REQUEST_URI} [QSA, L, R = 301]

Next, in the settings of the integration with the 1C software, a link with https is prescribed.

It should come out like this :

https://site.com/bitrix/admin/1c_exchange.php

Note that the https protocol is supported only on version 8.3.4 and higher. So make sure you have the correct version.

If it is impossible to set up integration from 1C via https, leave http. It is only necessary to edit the usual redirect to https as follows:

RewriteCond% {HTTP: X-Forwarded-Proto}! Https

RewriteCond% {REQUEST_URI}! ^ / Bitrix / admin / 1c_exchange \ .php $ [NC]

RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L, R = 301, NE]

If you use a CDN, go to the "CDN Site Acceleration" service settings. And then put a tick in the box "Site works on https".

And don't forget to include https for links in emails. This is done in the settings of the "E-mail marketing" module.

That's it, https setup for 1C-Bitrix is considered complete.

If problems arise, contact technical support. Tell them that you have a site on 1C-Bitrix and that you want to set up https. Technical support staff will clarify the essence of the problem and help to solve it.


Like the article? Tell your friends about it: