- Plesk for Linux
How to execute PHP files on the default web server page?
They are downloaded instead of being executed.
Only HTML files in default root path
/var/www/vhosts/default/htdocs can be executed and it is not recommended to change Plesk configuration for this default website.
Note: To serve domain contents on IP address follow this article: How to access a domain by IP address in Plesk.
Go to Plesk > Subscriptions and create a new subscription with the main server domain name, e.g.
example.com, by clicking the Add Subscription button.
Connect to the server via SSH.
.htaccessfile under the
# touch /var/www/vhosts/default/htdocs/.htaccess
Open the created
/var/www/vhosts/default/htdocs/.htaccessfile via any text editor and add the following row to it in order to set up the 302 redirect to the domain created at step 2:
CONFIG_TEXT: Redirect 302 / https://example.com/