Symptoms
-
Cannot change hosting type of the main domain of subscription: the button Change is not available in Domains > example.com > Hosting Settings > Hosting type:
-
It is not possible to switch the type from CLI also:
# 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:
# plesk db -Ne ‘SELECT count(*) FROM domains d1 LEFT JOIN domains d2 ON d1.id = d2.webspace_id WHERE d1.name = “example.com”;’
1
Cause
It is not possible to change the hosting type of the subscription’s main domain due to the internal limitations, as the additional domains have the content hosted within the main subscription’s domain.
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: It will not be possible to set the “No hosting” type that way.
If the “No hosting” type is needed, as a workaround, move the domain to a separate subscription as the main and only domain there.