<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
#Редирект с www на без www
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
#Редирект с HTTP на HTTPS
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
Listen 127.0.0.1:8888
<VirtualHost 127.0.0.1:8888>
ServerAdmin webmaster@localhost
DocumentRoot /home/bitrix/www
.....
<Directory /home/bitrix/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
DirectoryIndex index.php index.html index.htm
php_admin_value session.save_path /tmp/php_sessions/www
php_admin_value upload_tmp_dir /tmp/php_upload/www
Require all granted
</Directory>
...
</VirtualHost>