- Plesk for Linux
How to execute PHP files on the default web server page?
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.
Another way - create a new subscription with the main server domain name where PHP files will be executed and set up the redirect from default root path to this domain:
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/