Creating Subdomain

To create a subdomain, use the add operation and specify a parent website name, the subdomain name and subdomain properties.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet adding a new subdomain to Plesk, includes the add operation node:

<packet>
<subdomain>
   <add>
   ...
   </add>
</subdomain>
</packet>

The add node is presented by the SubdomainAddInputType (subdomain.xsd). Its graphical representation is as follows:

SubdomainAddInputType

Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.

 

Response Packet Structure

The add node of the output XML packet is structured as follows:

SubdomainAdd

 

Possible Errors

 

 

Samples

This packet creates subdomain sample.example.com with the home directory /sample, sets FTP account credentials, sets the SSI support, and enables using SSI for *.htm and *.html files on the subdomain:

<packet>
<subdomain>
 <add>
   <parent>example.com</parent>
   <name>sample</name>
   <property>
      <name>www_root</name>
      <value>/sample</value>
   </property>
   <property>
      <name>ftp_login</name>
      <value>john</value>
   </property>
   <property>
      <name>ftp_password</name>
      <value>sample</value>
   </property>
   <property>
      <name>ssi</name>
      <value>true</value>
   </property>
   <property>
      <name>ssi_html</name>
      <value>true</value>
   </property>
 </add>
</subdomain>
</packet>

For more properties examples, see Changing Subdomain Settings -> Request Samples.

Response:

<packet version="1.5.2.0">
<subdomain>
   <add>
      <result>
         <status>ok</status>
         <id>1</id>
      </result>
   </add>
</subdomain>
</packet>