Home     SSI Lab     CSS Templates     CSS     Htaccess     Web Design     XHTML

Htaccess Tutorials

graphic-img   

SSI-D HOME

SSI LAB

CSS Templates

CSS

.Htaccess

Introduction

Experimental

Web Design

(X)HTML

HTML-Kit

Resources





Changing the Default Directory Page

Introduction::

This guide shows you how to change your default directory page with the DirectoryIndex command. So what's a default directory page? When a URL or directory is requested a default page is loaded. For example if you go to http://ssi-developer.net/ it will serve up the default page which is index.shtml because my default page is index.htm, .html or .shtml. Using the DirectoryIndex command allows you to change your default page to anything you wish like "thisismydefaultpage.htm"



DirectoryIndex

Place the following in your .htaccess file:

DirectoryIndex default.htm

...where default.htm is obviously the default name you want.


If you also want certain scripts to run as default you can add other filenames to this:

DirectoryIndex default.htm home.cgi sadass.pl otherfile.html

What happens here is; if the URL in question is requested the server will look for default.htm and load it. If it does not find this page it will look for the next one home.cgi and if it finds it will load it, if it does not find this file it will search for the next in the list and so on.


Very simple, yah?




Advertisement Sign up for free to PayBox.me today and get $25 just for joining AND earn up to $20 per day for participating.