Standard paths to the root directories of sites look like this:
example.com/www
.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:
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 where the index file is located is different from www
... For example, Zend Framework - this requires an explicit indication of the main directory of the site 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 related to the root directory:
403
, check that the index file is in the root directory and that the site files are located correctly.404
, make sure that the path specified in the "Home directory», Exists on the hosting.