(mt):Changing default index page

  • This page was last modified on April 4, 2011, at 09:14.
The (mt) Community Wiki is a collaborative project. Any (mt) Media Temple customer or employee may contribute. Not all articles and/or content have been tested for accuracy by (mt) Media Temple.

For officially moderated and tested articles, be sure to visit our KnowledgeBase.

From (mt) Community Wiki

Contents

Overview

Want to make your website only use "index.php" instead of "index.html", or buck tradition and make your index file "BestPageEver.htm"? The world (wide web) can be yours, by adding a single line to your .htaccess file.

Important information before beginning

On the (ve) and (dv) Dedicated-Virtual Servers, this is written with the assumption that you are using Apache as the web server.

For more information about the .htaccess file, take a look at the .htaccess wiki entry.

Instructions

Open the .htaccess file in your favorite text editor, and add the following line:

DirectoryIndex filename.extension

So, if you want your index to be "index.html" instead of "index.php", you would use:

DirectoryIndex index.html

Now, if you want to have multiple options for a default page (for example, the main site uses "index.php", subfolder "A" uses "default.htm", and subfolder "B" uses "LookAtThis.html"), this can also be done by adding:

DirectoryIndex index.php default.htm LookAtThis.html

Save the file, upload it to your site (if you're editing it on your own computer), and voila, it's done!

Resources