Introduction
When a user visits a website folder without specifying a file, the server needs to know which file to show first. The index directive tells the server which file to look for and display automatically. This makes browsing websites smoother and friendlier.
When you want the server to automatically show the homepage file like index.html when someone visits your website root.
When you have multiple possible homepage files and want to set the order the server tries them.
When you want to change the default homepage file name to something custom like home.html.
When you want to prevent directory listing by ensuring a file is shown instead of a folder content.
When you want to serve a default file for a specific website location or folder.