• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Preferred Domain Setting through RPC API

michael.gysin

New Pleskian
Hello
If a create a subscription on a plesk Server through the API don't know how to specify the preferred domain and it's always set to domain.tld. I would like to set it to none for all.

My xml request:

Code:
<packet version="1.6.3.0">
  <webspace>
	<add>
	  <gen_setup>
		<name>' + @Domain + '</name>
		<owner-id>' + CONVERT(varchar, @PleskCustomerID) + '</owner-id>
		<ip_address>' + @ServerSharedIP + '</ip_address>
	  </gen_setup>
	  <hosting>
		<vrt_hst>
		  <property>
			<name>ftp_login</name>
			<value>' + @Username + '</value>
		  </property>
		  <property>
			<name>ftp_password</name>
			<value>' + @Password + '</value>
		  </property>
		  <ip_address>' + @ServerSharedIP + '</ip_address>
		</vrt_hst>
	  </hosting>
	  <prefs>
		<www>0</www>
		
	  </prefs>
	  <plan-name>' + @Template + '</plan-name>
	</add>
  </webspace>
</packet>

If I add an alias i can set it with prefs/seo-redirect.

How can I set it on a domain? Any ideas?

Thanks
Michael
 
Hi Michael,
have you find the way to set se-redirect during create the new site?
I still searching for this item.
Ali
 
Hello
If a create a subscription on a plesk Server through the API don't know how to specify the preferred domain and it's always set to domain.tld. I would like to set it to none for all.

My xml request:

Code:
<packet version="1.6.3.0">
  <webspace>
	<add>
	  <gen_setup>
		<name>' + @Domain + '</name>
		<owner-id>' + CONVERT(varchar, @PleskCustomerID) + '</owner-id>
		<ip_address>' + @ServerSharedIP + '</ip_address>
	  </gen_setup>
	  <hosting>
		<vrt_hst>
		  <property>
			<name>ftp_login</name>
			<value>' + @Username + '</value>
		  </property>
		  <property>
			<name>ftp_password</name>
			<value>' + @Password + '</value>
		  </property>
		  <ip_address>' + @ServerSharedIP + '</ip_address>
		</vrt_hst>
	  </hosting>
	  <prefs>
		<www>0</www>
		
	  </prefs>
	  <plan-name>' + @Template + '</plan-name>
	</add>
  </webspace>
</packet>

If I add an alias i can set it with prefs/seo-redirect.

How can I set it on a domain? Any ideas?

Thanks
Michael

I am sure you figured out this by now but thought i would add it for the rest of the internet who may be looking.
In the <vrt_hst> section add a new property type.

<property>
<name>seo-redirect</name>
<value>www</value>
</property>
 
and in case you want to set the non-www domain as preferred, such as domain.tld (and not www.domain.tld), you have to use property non-www:
<property>
<name>seo-redirect</name>
<value>non-www</value>
</property>
 
Back
Top