L
L
lolrofl012018-06-27 16:21:55
htaccess
lolrofl01, 2018-06-27 16:21:55

How to set a 301 redirect for all pages of the site?

Hey!
I moved the site to another domain, and it seems like I need to set up a 301 redirect for each page. But since the original structure has been preserved, in fact, I only need a redirect of the domain. Those. a person comes to site.ru - he redirects to site2.ru. Goes to site.ru/category/post - throws him to site2.ru/category/post. How to write it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
petyagrill, 2018-06-28
@lolrofl01

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} site.ru
RewriteRule (.*) http://site2.ru/$1 [R=301,L]

M
Maxim Timofeev, 2018-06-27
@webinar

Do you want to sell a secret place where there are answers? HERE!!!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question