Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to add a sub-domain in Plesk with www?  (Read 1801 times)

0 Members and 1 Guest are viewing this topic.

Givin Varghese

  • Guest
How to add a sub-domain in Plesk with www?
« on: November 30, 2013, 11:14:09 am »
How to add a sub-domain in Plesk with www

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.

Solution:

To make a subdomain work with ‘www’ 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.

Steps:

1. Create a vhost.conf file for the sub-domain

Code: [Select]
# cd /var/www/vhosts/domain.tld/subdomains/<sub-domain>/conf

# nano vhost.conf

and add a ServerAlias entry

ServerAlias www.subdomain.domain.tld

2. Add an ‘A’ record for the ‘www’ prefix of the sub-domain from

Quote
Plesk -> Domains -> <domain.tld> -> DNS Settings -> Add Record

www.subdomain.domain.tld         A        1.1.1.1

3. To apply the ServerAlias changes, run the websrvmng utility

Code: [Select]
# /usr/local/psa/admin/bin/websrvmng -a
4. Restart the webserver

Code: [Select]
# service httpd restart
Replace the subdomain/domain name and the 1.1.1.1 IP with the actual values.

Done  :o