2
Contributors
1
Reply
13
Views
11 Months
Discussion Span
Last Post by cereal
0

It is not automatic. When you call /main/ you point to a directory (aka folder) in the document root of the web server, to display by default a file you need to configure the server. This depends on the DirectoryIndex directive, if you are using Apache. The documentation says:

The DirectoryIndex directive sets the list of resources to look for, when the client requests an index of the directory by specifying a / at the end of the directory name. [...] Several URLs may be given, in which case the server will return the first one that it finds. If none of the resources exist and the Indexes option is set, the server will generate its own listing of the directory.

Source: https://httpd.apache.org/docs/current/mod/mod_dir.html#directoryindex

So you could have a list of available indexes:

DirectoryIndex default.htm index.php index.cgi index.html

and if inside /main/ you have both default.htm and index.php the server will load default.htm because of its precedence in the directive listing.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.