What is the difference between main/index.php and main/ ?

Can anyone help me figure that out?

I have edit http://www.masterlink.co.id/index.php file yet when I checked it in http://www.masterlink.co.id the file does not load index.php. I thought it suppose to be automatic like http://www.masterlink.co.id/index.php = http://www.masterlink.co.id

Can anyone help me figure why that happens?

Can anyone help me figure it out? It has many js codes it it.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.