U
U
ufaloony2017-02-09 06:46:07
htaccess
ufaloony, 2017-02-09 06:46:07

How to merge multiple domains with htaccess 301 redirect?

Good afternoon!
Tell me how to make a 301 redirect from several domains in different zones (.com, .org, etc.) to the main domain in the .ru zone?
Do I need to place non-primary domains on hosting or is it enough to set the redirect settings in the htaaccess file of the main site?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Taran, 2017-02-09
@ufaloony

you do not need to place it,
but A record must be registered on the DNS server that you use.
Next, in the admin panel of your server, add Aliases
In fact, mirrors. Specify which admin account I will tell you how to do it in more detail.
After you have specified aliases, the site is available on any of these sites without creating additional directories on the server.
in fact, in the virtual host of the site, this is also added

<VirtualHost *:80>
  ServerName  141.29.495.999
  ServerAlias example.com www.example.com example.ru www.example.kz

All that remains in .htaccess is to add a redirect rule for these sites.

A
Axian Ltd., 2017-02-09
@AxianLTD

The easiest way to do this is either at the DNS level, or using the DNS provider's "domain forwarding" service. And what does htaccess have to do with it - it's not clear? If htaccess - then requests are already coming to some host (i.e. DNS has already been resolved from some address). Well, yes, in
this case, you can register htaccess, and make separate pages with 301, and set up in Apache ... and much more how you can "glue".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question