We use cookies
We use cookies to optimize our website. By continuing to browse the site, you agree to our use of cookies.
Control panel
  • Русский
  • Українська
  • English
  • UAH
  • USD
  • RUB
  • EUR
  • 0-800-307-307 Hotline
  • +38 (044) 392-74-33 Kiev
  • +38 (057) 728-39-00 Kharkiv
  • +38 (056) 794-38-31 Dnipro
  • +38 (032) 229-58-93 Lviv
  • +38 (048) 738-57-70 Odessa
  • +38(093) 170-15-42  Life
  • +38 (067) 400-88-44 Kievstar
  • +1(888)393-24-51  USA, Toll free
  • +44(131)507-01-14  Great Britain
  • +7 (499) 348-28-61 Moscow

2.3.1.2. Site root directory

Standard paths to the root directories of sites look like this:

  • For a site on the main domain: example.com/www.
  • For a site on a subdomain: example.com/subdomain.

The full path to the directory with the site files can be found in the section "My sites»:

To change the site root directory to one of the subdirectories:

  1. Openup site settings.
  2. In field "Home directory»Specify the name of the subdirectory:
  3. Save your changes.
  4. Wait approximately 10-15 minutes for the changes to take effect.

If you need to host the site not in the root directory www, and, for example, in the directory www/ru, create a file index.php with the following content:

<?php
require_once("ru/index.php");
?>

Where ru/index.php Is the path to your site's index file.

Place the created file in the directory www and install right for him 750.

Also, be sure to set the parameter value open_basedir one level up to access other site directories.

In some frameworks it is required that the main directory of the site in which the index file is located be different from www... For example, Zend Framework - this requires an explicit indication of the main site directory public... You can work around this by creating in the root directory of the site (www) file .htaccess with content like this:

DirectoryIndex /public/index.php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.+) $1 [L]
RewriteCond %{DOCUMENT_ROOT}/public%{REQUEST_URI} -f
RewriteRule ^(.+) /public/$1 [L]

Another option:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/web/.*$
RewriteRule ^(.*)$ /web/$1 [QSA,L]

And further:

RewriteEngine on
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /public/$1 [L]

Errors when opening the site, which may be associated with the root directory:

  • If an error occurs 403, check if the index file is in the root directory and the site files are located correctly.
  • If an error occurs 404, make sure that the path specified in the "Home directory", Exists on the hosting.