A
A
alex9212018-05-31 13:21:41
htaccess
alex921, 2018-05-31 13:21:41

301 redirect from every page of one domain to the same address of another?

Hello! How to make a 301 redirect from each page of one domain to the same address of another?
Only the domain has changed, nothing else (example: it was https://tosmer.od.ua/ became https://tosmer.ua/ ).
I found this option:

RewriteEngine On
RewriteCond %{REQUEST_URI} (.*)
RewriteRule ^(.*)$ https://tosmer.ua/$1 [L,R=301]

Everything works. I just don't know if this option can be used.
PS: (Site on Bitrix).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2018-05-31
@shambler81

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

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question