{"id":2125,"date":"2014-06-26T23:34:36","date_gmt":"2014-06-26T19:34:36","guid":{"rendered":"https:\/\/blog.alwawee.ru\/?p=2125"},"modified":"2014-07-28T22:35:30","modified_gmt":"2014-07-28T18:35:30","slug":"add-www","status":"publish","type":"post","link":"https:\/\/blog.alwawee.ru\/?p=2125","title":{"rendered":"How to add www?"},"content":{"rendered":"<p>Let&#8217;s say, you have a website, that is opened by URL: <a href=\"http:\/\/ladby.ru\" title=\"http:\/\/ladby.ru\" target=\"_blank\">http:\/\/ladby.ru<\/a>. And you want to be able to open it by <a href=\"http:\/\/www.ladby.ru\" title=\"http:\/\/www.ladby.ru\" target=\"_blank\">http:\/\/www.ladby.ru<\/a> also. What should you do? I will describe it now. <\/p>\n<p>In this case <strong>www<\/strong> is a subdomain for your website. It is useful usually if you want to have also <strong>ftp.ladby.ru<\/strong> for instance. Also it can be useful to redirect from www.ladby.ru so that some users that type your website URL with <strong>www<\/strong> will not have any problems accessing it. <a href=\"http:\/\/superuser.com\/questions\/60006\/what-is-the-purpose-of-the-www-subdomain\" title=\"http:\/\/superuser.com\/questions\/60006\/what-is-the-purpose-of-the-www-subdomain\" target=\"_blank\">Here<\/a> is more information on what is the purpose of the <strong>www<\/strong> subdomain. <\/p>\n<p>To achieve this, you should create a <a href=\"http:\/\/en.wikipedia.org\/wiki\/CNAME_record\" title=\"http:\/\/en.wikipedia.org\/wiki\/CNAME_record\" target=\"_blank\">CNAME<\/a> record in your DNS Zone file. Basicly, CNAME record tells where one should be redirected. <\/p>\n<p>I have a record:<\/p>\n<pre>\r\n@                        IN A       78.47.91.3\r\n<\/pre>\n<p>Here @ sign means basic address: <strong>ladby.ru<\/strong> in this case. So when somebody wants to open <strong>ladby.ru<\/strong>, he is redirected to the <strong>78.47.91.3<\/strong> IP address. <a href=\"http:\/\/en.wikipedia.org\/wiki\/A_record#A\" title=\"http:\/\/en.wikipedia.org\/wiki\/A_record#A\" target=\"_blank\">A-record<\/a> returns a 32-bit IPv4 address, most commonly used to map hostnames to an IP address of the host.<\/p>\n<p>Also I have added an important record, which is the core of the trick: <\/p>\n<pre>\r\nwww                      IN CNAME   @\r\n<\/pre>\n<p>So, when somebody wants to open <strong>www<\/strong> subdomain, he is redirected to basic address or <strong>ladby.ru<\/strong>.<\/p>\n<p>In my case the final result looks like this:<\/p>\n<pre>\r\n$TTL 86400\r\n@   IN SOA ns1.first-ns.de. postmaster.robot.first-ns.de. (\r\n    2014062605   ; serial\r\n    14400        ; refresh\r\n    1800         ; retry\r\n    604800       ; expire\r\n    86400 )      ; minimum\r\n \r\n@                        IN NS      robotns3.second-ns.com.\r\n@                        IN NS      robotns2.second-ns.de.\r\n@                        IN NS      ns1.first-ns.de.\r\n \r\n@                        IN A       78.47.91.3\r\nlocalhost                IN A       127.0.0.1\r\nmail                     IN A       78.47.91.3\r\nftp                      IN CNAME   www\r\nimap                     IN CNAME   www\r\nloopback                 IN CNAME   localhost\r\npop                      IN CNAME   www\r\nrelay                    IN CNAME   www\r\nsmtp                     IN CNAME   www\r\nwww                      IN CNAME   @\r\n@                        IN MX 10   mail\r\n<\/pre>\n<p>Also, you should edit your Apache configuration file this way: <\/p>\n<pre>\r\n# cd \/etc\/apache2\/sites-available\r\n# vim ladby.conf\r\n\r\nServerName www.ladby.ru\r\n<\/pre>\n<p>It should not be like this:<\/p>\n<pre>\r\nServerName ladby.ru\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[76,77,82,75,81],"class_list":["post-2125","post","type-post","status-publish","format-standard","hentry","category-web-development","tag-apache","tag-dns","tag-hosting","tag-web","tag-www"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to add www? - Denis Kutlubaev<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.alwawee.ru\/?p=2125\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to add www? - Denis Kutlubaev\" \/>\n<meta property=\"og:description\" content=\"Let&#8217;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 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.alwawee.ru\/?p=2125\" \/>\n<meta property=\"og:site_name\" content=\"Denis Kutlubaev\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/alwaweemobile\" \/>\n<meta property=\"article:published_time\" content=\"2014-06-26T19:34:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-07-28T18:35:30+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/blog.alwawee.com\/?attachment_id=1982\" \/>\n<meta name=\"author\" content=\"Denis Kutlubaev\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Denis Kutlubaev\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2125#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2125\"},\"author\":{\"name\":\"Denis Kutlubaev\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#\\\/schema\\\/person\\\/58f1f1f57155b48afab83ba53b3e26a7\"},\"headline\":\"How to add www?\",\"datePublished\":\"2014-06-26T19:34:36+00:00\",\"dateModified\":\"2014-07-28T18:35:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2125\"},\"wordCount\":237,\"commentCount\":0,\"keywords\":[\"Apache\",\"DNS\",\"hosting\",\"Web\",\"www\"],\"articleSection\":[\"Web Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2125#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2125\",\"url\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2125\",\"name\":\"How to add www? - Denis Kutlubaev\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#website\"},\"datePublished\":\"2014-06-26T19:34:36+00:00\",\"dateModified\":\"2014-07-28T18:35:30+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#\\\/schema\\\/person\\\/58f1f1f57155b48afab83ba53b3e26a7\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2125#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2125\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/?p=2125#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.alwawee.ru\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to add www?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#website\",\"url\":\"https:\\\/\\\/blog.alwawee.ru\\\/\",\"name\":\"Denis Kutlubaev\",\"description\":\"iOS Development\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.alwawee.ru\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.alwawee.ru\\\/#\\\/schema\\\/person\\\/58f1f1f57155b48afab83ba53b3e26a7\",\"name\":\"Denis Kutlubaev\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg\",\"caption\":\"Denis Kutlubaev\"},\"description\":\"iOS Developer, creator of Tornado Browser and many other popular apps\",\"sameAs\":[\"http:\\\/\\\/dennis.alwawee.com\"],\"url\":\"https:\\\/\\\/blog.alwawee.ru\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to add www? - Denis Kutlubaev","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.alwawee.ru\/?p=2125","og_locale":"en_US","og_type":"article","og_title":"How to add www? - Denis Kutlubaev","og_description":"Let&#8217;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 [&hellip;]","og_url":"https:\/\/blog.alwawee.ru\/?p=2125","og_site_name":"Denis Kutlubaev","article_publisher":"https:\/\/www.facebook.com\/alwaweemobile","article_published_time":"2014-06-26T19:34:36+00:00","article_modified_time":"2014-07-28T18:35:30+00:00","og_image":[{"url":"http:\/\/blog.alwawee.com\/?attachment_id=1982","type":"","width":"","height":""}],"author":"Denis Kutlubaev","twitter_misc":{"Written by":"Denis Kutlubaev","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.alwawee.ru\/?p=2125#article","isPartOf":{"@id":"https:\/\/blog.alwawee.ru\/?p=2125"},"author":{"name":"Denis Kutlubaev","@id":"https:\/\/blog.alwawee.ru\/#\/schema\/person\/58f1f1f57155b48afab83ba53b3e26a7"},"headline":"How to add www?","datePublished":"2014-06-26T19:34:36+00:00","dateModified":"2014-07-28T18:35:30+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.alwawee.ru\/?p=2125"},"wordCount":237,"commentCount":0,"keywords":["Apache","DNS","hosting","Web","www"],"articleSection":["Web Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.alwawee.ru\/?p=2125#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.alwawee.ru\/?p=2125","url":"https:\/\/blog.alwawee.ru\/?p=2125","name":"How to add www? - Denis Kutlubaev","isPartOf":{"@id":"https:\/\/blog.alwawee.ru\/#website"},"datePublished":"2014-06-26T19:34:36+00:00","dateModified":"2014-07-28T18:35:30+00:00","author":{"@id":"https:\/\/blog.alwawee.ru\/#\/schema\/person\/58f1f1f57155b48afab83ba53b3e26a7"},"breadcrumb":{"@id":"https:\/\/blog.alwawee.ru\/?p=2125#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.alwawee.ru\/?p=2125"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.alwawee.ru\/?p=2125#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.alwawee.ru\/"},{"@type":"ListItem","position":2,"name":"How to add www?"}]},{"@type":"WebSite","@id":"https:\/\/blog.alwawee.ru\/#website","url":"https:\/\/blog.alwawee.ru\/","name":"Denis Kutlubaev","description":"iOS Development","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.alwawee.ru\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.alwawee.ru\/#\/schema\/person\/58f1f1f57155b48afab83ba53b3e26a7","name":"Denis Kutlubaev","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/346de75d27c818be0aa7fddeada2e50e30cc15b4da6b3b8110c5d766cd2afa34?s=96&d=mm&r=pg","caption":"Denis Kutlubaev"},"description":"iOS Developer, creator of Tornado Browser and many other popular apps","sameAs":["http:\/\/dennis.alwawee.com"],"url":"https:\/\/blog.alwawee.ru\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/posts\/2125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2125"}],"version-history":[{"count":0,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=\/wp\/v2\/posts\/2125\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.alwawee.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}