Bitrix Site Manager

GetDirIndex

string
GetDirIndex(
 string path,
 string index = false
)

The function GetDirIndex returns the name of a directory index file.

Parameters

ParameterDescription
path Path to the directory relative to root to which an index file is to be returned.
index Possible names of index files separated with spaces, in descending priority order.

Important note
If run under an Apache server, pass the DirectoryIndex field value of web server settings in this parameter. For IIS, this parameter can be found in the site properties, tab "Documents" -> "Enable default content page".

Optional. False by default which means that the value is to be taken from the constant DIRECTORY_INDEX; if the constant is not defined the value "index.php index.html index.htm index.phtml default.html index.php3" is used by default.

The following algorithm is used to find a directory index file:

  1. A value from the parameter index is taken. If the parameter is not specified the value of the constant DIRECTORY_INDEX is taken. This constant can be defined in file /bitrix/php_interface/dbconn.php or in files /bitrix/php_interface/site ID/init.php. If the constant value is not specified the value "index.php index.html index.htm index.phtml default.html index.php3" is used by default.
  2. The obtained value is tokenized by spaces into separate file names.
  3. Each file is checked for existence in the directory.
  4. The first found file is considered the directory index page.

See Also