0

I'm trying to create subdomains using the Plesk API:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<packet version="1.6.3.2">
    <subdomain>
        <add>
            <parent>example.com</parent>
            <name>testing</name>
            <property>
                <name>php</name>
                <value>true</value>
            </property>
        </add>
    </subdomain>
</packet>

This does create the subdomain, but sets it to use the httpdocs folder (i.e., the same folder as the parent domain).

I reread the documentation, and tried again with the <home> element:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<packet version="1.6.3.2">
    <subdomain>
        <add>
            <parent>example.com</parent>
            <name>testing</name>
            <home>subdomain/testing</home>
            <property>
                <name>php</name>
                <value>true</value>
            </property>
        </add>
    </subdomain>
</packet>

That results in an error message:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.3.2">
  <subdomain>
    <add>
      <result>
        <status>error</status>
        <errcode>1017</errcode>
        <errtext>Feature supports only for windows version. Request should not have the  home  parameter.</errtext>
      </result>
    </add>
  </subdomain>
</packet>

Surely there's some way to achieve this? (And, frankly, the default behaviour is weird.)

1
0

It is poorly documented indeed, but you could probably try the following example (worked on my 11.0):

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.3.5">
    <subdomain>
        <add>
            <parent>domain.com</parent>
            <name>sub</name>
            <property>
                <name>www_root</name>
                <value>/another_docroot</value>
            </property>
        </add>
    </subdomain>
</packet>

It might not work with earlier Plesk versions though.

1
  • For some reason, I wasn't notified of this answer. It never arrived in my inbox. I've tested it now, and it works. Thanks.
    – TRiG
    Oct 5 '12 at 11:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.