M
M
Maria Popova2021-04-09 13:29:21
1C-Bitrix
Maria Popova, 2021-04-09 13:29:21

How to set up a 301 redirect from one domain to another on Bitrix?

A site on Bitrix was transferred from one domain to another. Now you need to redirect from the first site to the second, but with the path saved, for example: sitter1.ru/test/ will redirect site2.ru/test/
Tried like this:
RewriteCond %{HTTP_HOST} test.ru
RewriteRule (.*) https:// test2.ru/$1 [R=301]
but redirects to https://test2.ru/bitrix/urlrewrite.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2021-04-10
@shambler81

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.|)site\.ru [NC]
RewriteRule ^(.*)$ https://site2.ru/$1 [R=301,L]

and of course to the Bitrix core, htaccess is read from top to bottom

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question