{"id":1440,"date":"2011-09-17T11:38:25","date_gmt":"2011-09-17T15:38:25","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=1440"},"modified":"2013-03-20T08:44:20","modified_gmt":"2013-03-20T12:44:20","slug":"how-to-add-a-sub-domain-in-plesk-with-www-prefix","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/how-to-add-a-sub-domain-in-plesk-with-www-prefix","title":{"rendered":"How to add a sub-domain in Plesk with www prefix?"},"content":{"rendered":"<p>Generally, a sub-domain is not accessed using the www prefix i.e. you can access subdomain.domain.tld but not www.subdomain.domain.tld by default.<\/p>\n<p><span style=\"color: #3366ff;\"><strong>Solution:<\/strong><\/span><\/p>\n<p>To make a subdomain work with &#8216;www&#8217; prefix on a Plesk server, you have to add a ServerAlias entry in the vhost configuration of the sub-domain and add an A record from Plesk.<\/p>\n<p><span style=\"color: #3366ff;\"><strong>Steps:<\/strong><\/span><\/p>\n<p><strong>1.<\/strong> Create a vhost.conf file for the sub-domain<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># cd \/var\/www\/vhosts\/domain.tld\/subdomains\/&lt;sub-domain&gt;\/conf<\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"># nano vhost.conf<\/span><\/pre>\n<\/blockquote>\n<p>and add a ServerAlias entry<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\">ServerAlias www.subdomain.domain.tld<\/span><\/pre>\n<\/blockquote>\n<p><strong>2.<\/strong> Add an &#8216;A&#8217; record for the &#8216;www&#8217; prefix of the sub-domain from<br \/>\n<strong>\u00a0\u00a0\u00a0\u00a0 Plesk -&gt; Domains -&gt; &lt;domain.tld&gt; -&gt; DNS Settings -&gt; Add Record<\/strong><\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\">www.subdomain.domain.tld A 1.1.1.<strong>1<\/strong><\/span><\/pre>\n<\/blockquote>\n<p><strong>3.<\/strong> To apply the ServerAlias changes, run the <strong>websrvmng<\/strong> utility<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># \/usr\/local\/psa\/admin\/bin\/websrvmng -a<\/span><\/pre>\n<\/blockquote>\n<p><strong>4.<\/strong> Restart the webserver<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># service httpd restart<\/span><\/pre>\n<\/blockquote>\n<p>Replace the subdomain\/domain name and the 1.1.1.1 IP with the actual values.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Generally, a sub-domain is not accessed using the www prefix i.e. you can access subdomain.domain.tld but not www.subdomain.domain.tld by default.<br \/>\nSolution:<br \/>\nTo make a subdomain work with &#8216;www&#8217; prefix on a Plesk server, you have to add a ServerAlias entry in the vhost configuration of the sub-domain and add an A record from Plesk.<br \/>\nSteps:<br \/>\n1. Create a vhost.conf file for the sub-domain<\/p>\n<p># cd \/var\/www\/vhosts\/domain.tld\/subdomains\/&lt;sub-domain&gt;\/conf<br \/>\n# nano vhost.conf<\/p>\n<p>and add a ServerAlias entry<\/p>\n<p>ServerAlias www.subdomain.domain.tld<\/p>\n<p>2. Add an &#8216;A&#8217; record for the &#8216;www&#8217; prefix of the sub-domain from<br \/>\n\u00a0\u00a0\u00a0\u00a0 Plesk -&gt; Domains -&gt; &lt;domain.tld&gt; -&gt; DNS Settings [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[1296,1300,1301,1299,1297,1298],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1440"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=1440"}],"version-history":[{"count":7,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1440\/revisions"}],"predecessor-version":[{"id":2286,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1440\/revisions\/2286"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=1440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=1440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=1440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}