Why use different index files

webServerToolsYou may find for improved security reasons that your web host is prescriptive about what is an acceptable index files and subsequently you might wish to use an alternative file. This article describes how to go about this using a .htaccess file.


.htaccess

Start by accessing the root of your website. Create a .htaccess file, and add one of the following example lines:

DirectoryIndex myindexfile.php

This will cause the web server to look only for myindexfile.php. If there is no such a file it will list the contents of the directory.

 

Akeeba Backup example

I needed to use this method when restoring with Akeeba Backup kickstart.php file. Importantly as part of the restoration process, kickstart recreates the original index.php file (and the .htaccess file).

 

Thanks for visiting,
Steven