Symptoms
-
Cannot change the hosting type of the main domain of a subscription: the button Change is not shown next to Hosting type under Domains > example.com > Hosting Settings:
-
On attempts to change the type from CLI, the following message is shown:
# plesk bin site -u example.com -hst_type std -target_url example.net
Subscription contains sites, therefore, you cannot change hosting type or delete it.
exit status 1 -
There are additional domains available in the subscription:
Cause
It is not possible to change the hosting type of the subscription's main domain if there are additional domains due to external limitations.
The additional domains have the content hosted within the main domain's directory.
Resolution
Consider voting for the corresponding feature request.
As a workaround, configure the forwarding type manually on the domain:
Forwarding with 301/302 code
-
For Linux
-
Disable the Permanent SEO-safe 301 redirect from HTTP to HTTPS option in the Domains > example.com > Hosting Settings
-
Navigate to Domains > example.com > Apache & nginx Settings
-
Add the following directives to both Additional directives for HTTP and Additional directives for HTTPS:
Redirect 301 / https://example.net/
Note: Replace the https://example.net/ with the desired target location. In case 302 redirect is required, change 301 to 302.
-
Add the following directives to Additional nginx directives, if it is present:
return 301 $scheme://example.net/$request_uri;
Note: The directives above can only be modified by Plesk Administrator. In case they are absent, contact service provider and ask to apply this article.
-
For Windows
-
Navigate to Domains > example.com > File Manager
-
Open
web.config
file and add the following content right below the <system.webServer> declaration:<httpRedirect enabled="true" destination="https://example.net/" httpResponseStatus="Permanent" />
Note: Replace the https://example.net/ with the desired target location. In case 302 redirect is required, change Permanent status to Found.
Frame forwarding
-
Navigate to Domains > example.com > File Manager and create an
index.html
file with the following content:<html><head><title>Title</title></head>
<style>
body {
margin: 0;
padding: 0;
}
body, iframe {
width: 100%;
height: 100%;
}
iframe {
border: 0;
}
</style>
<body>
<iframe src="https://example.net"/>
</body>
</html>Note: Replace the http://example.net/ with the desired target location. The target domain must allow iframes: Domain that has frame forwarding hosting type shows blank page
-
Set the index.html as the main index document: How to set default index file for a domain in Plesk Onyx
Note: There is no such a workaround for settings the "No hosting" type.
If the "No hosting" type is needed, as a workaround, move the domain to a separate subscription as the main and only domain there.