Tag Archives: www

How to add www?

Let’s say, you have a website, that is opened by URL: http://ladby.ru. And you want to be able to open it by http://www.ladby.ru also. What should you do? I will describe it now.

In this case www is a subdomain for your website. It is useful usually if you want to have also ftp.ladby.ru for instance. Also it can be useful to redirect from www.ladby.ru so that some users that type your website URL with www will not have any problems accessing it. Here is more information on what is the purpose of the www subdomain.

To achieve this, you should create a CNAME record in your DNS Zone file. Basicly, CNAME record tells where one should be redirected.

I have a record:

Here @ sign means basic address: ladby.ru in this case. So when somebody wants to open ladby.ru, he is redirected to the IP address. A-record returns a 32-bit IPv4 address, most commonly used to map hostnames to an IP address of the host.

Also I have added an important record, which is the core of the trick:

So, when somebody wants to open www subdomain, he is redirected to basic address or ladby.ru.

In my case the final result looks like this:

Also, you should edit your Apache configuration file this way:

It should not be like this: