• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

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