N
N
Nikolai2014-10-05 23:24:37
Domain Name System
Nikolai, 2014-10-05 23:24:37

How to correctly configure the behavior of subdomains in DNS?

There is a site that has a rule in .htaccess that redirects all addresses from www to "without www".
In DNS, both @ and www have an A record with the same server IP.
1. What happens if you delete the A record for the www subdomain and put a CNAME on the main mirror instead? Will there be redirects to specific pages? Or any www url will only redirect to the main site without www?
2. If pages with www will correctly redirect to the corresponding pages without www, is it possible to remove the rule duplicating this process from .htaccess?
3. What happens if you use the mask * CNAME along with those subdomains for which CNAME is already set (for example, whether the mail CNAME domain.mail.yandex.net rule continues to run. )?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Chistyakov, 2014-10-05
@pragmatik

1. Nothing will change.
2. CNAME records have nothing to do with HTTP redirect, so nothing in .htaccess can be changed.
3. I don't remember exactly if it is possible to specify a wildcard in CNAME, but if possible, it will work the same way as for A records - that is, the rule will continue to be executed, yes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question