Plesk

How to change the document root for a single domain on Plesk?

Question

How to change the document root for a single domain on Plesk?

Answer

It is possible to change the document root using the following steps:

via Plesk

  1. Log in to Plesk.
  2. Go to Domains > example.com > Hosting Settings.
  3. In the Document root field specify the required name for the new document root.
  4. Press the OK button.

via CLI

  1. Connect to the server via SSH or RDP.

  2. (On Windows) Run Command Prompt as administrator.

  3. Use the following command to customize the document root:

    # plesk bin domain -u example.com -www-root httpdocsnew

    Note: 'httpdocsnew' in this example is relative to the subscription root /var/www/vhosts/example.com/ or %plesk_vhosts%example.com. In other words, the absolute path to the new directory is /var/www/vhosts/example.com/httpdocsnew or %plesk_vhosts%example.com/httpdocsnew.

Exit mobile version