• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

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