A
A
Alexey Ivanov2019-05-16 11:56:16
1C-Bitrix
Alexey Ivanov, 2019-05-16 11:56:16

Redirect from each page of one domain to the same address of another. How?

Good afternoon. Moved a site from one domain to another. You need to set up a redirect from each page of the old domain to the same address of the new one. Tried two rules
RewriteCond %{REQUEST_URI} (.*)
RewriteRule ^(.*)$ https://site.ru/$1 [L,R=301]
and
RewriteEngine On
RewriteCond %{REQUEST_URI} (.*)
RewriteRule ^( .*)$ https://site.ru/$1 [L,R=301]
Both do not work in all cases. For example, old.ru/new/ -> site.ru/new/ - everything is fine, it redirects. But if there is another subpage on the page, for example old.ru/new/novay-novost/ - then the redirect occurs to site.ru//bitrix/urlrewrite.php
What could be the reason? In which direction to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-05-16
@ivanovav27

Move the redirect to the beginning of the file so that it is above the ruleRewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question