string
GetDirIndex(
string path,
string index = false
)
The function GetDirIndex returns the name of a directory index
file.
Parameters
| Parameter | Description |
| 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:
- 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.
- The obtained value is tokenized by spaces into separate file names.
- Each file is checked for existence in the directory.
- The first found file is considered the directory index page.
See Also