T
T
the_short_link2018-03-29 21:34:09
Domain Name System
the_short_link, 2018-03-29 21:34:09

How to make site.ru on one hosting, www.site.ru on another?

How can I make sure that site.ru is on one hosting, and www.site.ru is on another? At the same time, it is necessary that from site.ru there is a redirect to www.site.ru. The main goal of this action is that when checking in various services, site.ru shows the DNS of site.ru hosting, and not hosting www.site.ru. The idea so far is this, physically the site is located on www.site.ru, and .htaccess with a redirect is located on site.ru

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

With regards to domains, I plan to hang www on another hoster through the A-record. Will this work?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question