Paths and folders

On PHP webhosting plans, the root folder is /var/www/[domain]/, and all website files must be placed in the public_html folder, which cannot be changed.

The path to the root folder on PHP web hosting plans is /var/www/[domain]/

If you need to access the public_html folder, the path will therefore be /var/www/[domain]/public_html/

Webroot / document root

Files and folders that need to be displayed on the website must be placed in the public_html folder, which must be located in the root folder. It is not possible to change this.
Files placed outside the public_html folder cannot be accessed by the browser/visitors.

Start files

On a PHP web hosting plan, your start file (the file that is read when a user visits http://www.ditdomæne.dk) must be named one of the following:

  1. index.php
  2. index.phtml
  3. index.shtml
  4. index.htm
  5. index.html

The files are read in the order above, so the first mentioned have higher priority than the rest.
Remember that file names are case-sensitive, so Index.php is not the same as index.php.

Symfony

By default, Symfony uses the public folder as the root folder (Document-Root), and not public_html, as our servers do.

You need to change Symfony's public folder to public_html; how to do this is described here: https://symfony.com/doc/current/configuration/override_dir_structure.html#override-web-dir

Laravel

By default, Laravel uses the public folder as the root folder (DocumentRoot), and not public_html, as our servers do.

To solve this, you can either change the Laravel configuration so that it uses the public_html folder instead of public, or you can create a so-called symlink from public to public_html.
You can create a symlink with the command ln -s public public_html via SSH. Note that the public_html folder must not already exist when you create the symlink.

Article from the support category: PHP