L
L
LNK2016-01-22 17:14:23
Web development
LNK, 2016-01-22 17:14:23

How to redirect from one site to another?

In general, the goal is such that when we try to go to one site, for example google.ru, we are transferred to another site in any browser, for example mail.ru. I thought to do it through hosts, but since one ip can correspond to many sites, this method is not suitable. What other ways are there to do this? have access to a PC.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dimonchik, 2016-01-22
@dimonchik2013

install browser extension

M
Maxim, 2016-01-22
@kisliymaxim

Here is an article , see if it helps.

M
Max, 2016-01-23
@SuperMax899

You asked incorrectly, do you have a website and do you need to be redirected to another when entering it?
You can make a substitution, when you enter domen-1, switch to domen-2, it's easier. In the main directory on the hosting there is .htaccess, add the following there:
# HTTP Rule
RewriteCond %{HTTP_HOST} ^www.domen-1\.ru
RewriteRule ^(.*)$ domen-2/$1 [R=301,L]
RewriteCond % {HTTP_HOST} ^www.domen-2\.ru
RewriteRule ^(.*)$ domen-2/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^domen-1\.ru
RewriteRule ^(.*)$ domen-2.ru/$1 [R=301,L]
According to the subject, beget technical domains should work like regular ones.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question