Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 A folder that acts like a file?
Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
HazySmoke)345




PostPosted: Tue Mar 13, 2007 3:53 pm   Post subject: 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?
Sponsor
Sponsor
Sponsor
sponsor
octopi




PostPosted: Tue Mar 13, 2007 4:10 pm   Post subject: 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




PostPosted: Tue Mar 13, 2007 5:43 pm   Post subject: Re: A folder that acts like a file?

in *nix, folders are special files
PaulButler




PostPosted: Tue Mar 13, 2007 6:50 pm   Post subject: RE:A folder that acts like a file?

It can also be done dynamically. Google mod_rewrite if you are interested.
rdrake




PostPosted: Tue Mar 13, 2007 7:36 pm   Post subject: Re: A folder that acts like a file?

bugzpodder @ Tue Mar 13, 2007 5:43 pm wrote:
in *nix, folders are special files
In *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




PostPosted: Tue Mar 13, 2007 10:50 pm   Post subject: 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




PostPosted: Wed Mar 14, 2007 9:18 am   Post subject: Re: RE:A folder that acts like a file?

md @ Tue Mar 13, 2007 10:50 pm wrote:
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.
Display posts from previous:   
   Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: