apache tutorial - Default directory index page - apache - apache web server - apache server - apache2




  • Directoryindex describes, how to use the apache directory index directive in an .htaccess file to specify which page is displayed when visitors request a directory.

Changing the default directory index page:

  • The apache server or web server is specially named files as the first page of in our website (set index ), also known as the index page.
  • The server looks for the default order of index file names as index.htm as number 1, index.html as number 2, index.php as number 3, and finally ends up with htaccess redirect default.htm.
  • we can change the name of the index file. So that, our account works based on redirection of .htaccess file.
  • Perhaps, we want to have a specific custom name in our directory index htaccess file or maybe we are migrating from another host and the index page is named differently.
  • The above method enables our internal links to be not broken by renaming the index file.
filename with the file that we want to display whenever a user requests the directory:


  • we can also specify multiple filenames, and the web server will search for each file until it finds a match.

  • In this directive, when a user requests the directory name, the web server first looks for an index.php file.
  • If it does not find an index.php file, it looks for an index.html file, and so on until it finds a match or runs out of files to search.
  • If we want the directory index page setting to apply to our entire web site, add the DirectoryIndex directive to the .htaccess file in the public_html directory.
  • All subdirectories do not have their own htaccess file and it will inherit the setting from the main directory file.

Below image shows you, How to Set root folder in wordpress :


Related Searches to Default Directory Index Page