
-----------------------------------
HazySmoke)345
Tue Mar 13, 2007 3:53 pm

A folder that acts like a file?
-----------------------------------
The following URL leads to the homepage of this web site.

http://www.compsci.ca/v3/

You notice how there is no file name under the folder v3? I was expecting it to be like www.compsci.ca/v3/blahblah.html, but I don't see the filename at all.

How is this possible?

-----------------------------------
octopi
Tue Mar 13, 2007 4:10 pm

Re: A folder that acts like a file?
-----------------------------------
Its called the DirectoryIndex, it is usually set to index.html or index.php

If a file name isn't specified it loads the index.html, or index.php file.

Read up on the apache documentation (if your webserver is apache), more specifically the 'DirectoryIndex' directive.

-----------------------------------
bugzpodder
Tue Mar 13, 2007 5:43 pm

Re: A folder that acts like a file?
-----------------------------------
in *nix, folders are special files

-----------------------------------
PaulButler
Tue Mar 13, 2007 6:50 pm

RE:A folder that acts like a file?
-----------------------------------
It can also be done dynamically. Google mod_rewrite if you are interested.

-----------------------------------
rdrake
Tue Mar 13, 2007 7:36 pm

Re: A folder that acts like a file?
-----------------------------------
in *nix, folders are special filesIn *nix, everything is a file!

Seriously though, yes, every server has a way to specify the default file if none is specified.  Typical examples include the following.
index.html
index.php
default.asp
default.aspx
Etc.
Mod_rewrite is a good one too.

-----------------------------------
md
Tue Mar 13, 2007 10:50 pm

RE:A folder that acts like a file?
-----------------------------------
Or just rewrite for lighttpd. I should really start plugging lighttpd whenever someone says something about apache.

-----------------------------------
PaulButler
Wed Mar 14, 2007 9:18 am

Re: RE:A folder that acts like a file?
-----------------------------------
Or just rewrite for lighttpd. I should really start plugging lighttpd whenever someone says something about apache.

lighttpd is a nice server, I left it out of my post in order to not confuse things.

I like mod_rewrite better because it can be written in the .htaccess file, doesn't lighttpd require it be in the lighttpd.conf file? Unless there is a way around it, this would get annoying.
