tags:

views:

25

answers:

3

Hi All,

It's been a while since I created a new directory on my domain (call it my/domain/dir3). I have others, each containing a index.php (dir1/index.php - dir2/index.php), each index is called if the directory URL is called (thus a URL of my/domain/dir1 will call my/domain/dir1.index.php).

No the embarrasing part ... I've completely forgotten how I did this! ... blank .... nothing ... no recollection. Please somebody enlighten me.

+1  A: 

If you use Apache, it does this automatically. You can tweak the settings in httpd.conf though.

dark_charlie
A: 

Well if it's a standard Apache/PHP installation then putting an index.php file in the directory would make it the default page in a directory.

Oh, if you want a different file to be the index. Create a .htaccess file in the directory and enter this:

DirectoryIndex index.html index.htm index.php something.php

Replace something.php with the file you want and presto ;). You can't have two indexes.

Stephen
A: 

If index.php is seen by Apache as the default index file, my/domain/dir1/ will see my/domain/dir1/index.php. If you want something more complex, You'll need mod_rewrite.

Dave Everitt