How to change the default index page using a .htaccess file?

The below command will set the default page your website shows to whatever you specify. For example the below command will set your website to show the index.html file as default.

DirectoryIndex index.html

The below change will attempt to show business.html as the default page for your website and every directory.

DirectoryIndex business.html

And you can even do something cool like have it load a movie or image by default.

DirectoryIndex cool.mov

Or even specify multiple files so that it will try to load the first one, then the next, and so on. So with the below line it would try to load business.html, then if that wasn’t there index.cgi, and if that wasn’t there index.pl, and so on.

DirectoryIndex business.html index.cgi index.pl default.htm

If it can’t find the file you specify it will revert to a directory listing of the files in that folder.

 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to do a Tracert?

This tutorial will show you how to run a trace route on a Window operating system. If you are...

How to do a TELNET on a PC (Windows) OS?

From time to time you may need to perform an operation called "TELNET".You can use TELNET to...

How to do a Ping?

The purpose of this tutorial is to teach you how to do a ping. Pinging is a command which tells...

How to Clear Your Cache in Internet Explorer?

This tutorial will assist you with clearing your cache, which will help your computer run...

Error Page Codes

This tutorial will show you a few of the most common error codes a server may return. There are...