User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Site Layout and Usability section within the Web Development category of DaniWeb, a massive community of 391,186 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,667 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Site Layout and Usability advertiser:
Views: 1585 | Replies: 7
Reply
Join Date: Oct 2007
Posts: 4
Reputation: EthanB is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
EthanB EthanB is offline Offline
Newbie Poster

Question Directory Structure/No Index file?

  #1  
Oct 8th, 2007
I can't seem to figure this out:
  1. I go to some random Website.
  2. I click on a link to their portfolio page
  3. Then I check the URL bar to find something along the lines of "www.supercoolsite.com/portfolio"
  4. Now I notice there is no "index.*" file
  5. So I type in "www.supercoolsite.com/portfolio/index.html"
  6. That seems to work, but then I try index.php. That also works.
  7. Finally I try adding "ThisCan'tPossiblyWork.ItWon't"
  8. And of course that also works...

So my question is: How do they accomplish this? I can't find any information whatsoever on this issue. I've lost sleep at night! Please help!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Posts: 2,510
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 103
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Directory Structure/No Index file?

  #2  
Oct 8th, 2007
Different web hosting companies have different defaults.
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Oct 2007
Posts: 4
Reputation: EthanB is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
EthanB EthanB is offline Offline
Newbie Poster

Re: Directory Structure/No Index file?

  #3  
Oct 8th, 2007
Originally Posted by MidiMagic View Post
Different web hosting companies have different defaults.

Okay, so it's based on how the company does it... But are they folders (the "portfolio") or files that the hosting company has striped the .* extension, or...? I still don't get it, but thanks though!
Last edited by EthanB : Oct 8th, 2007 at 10:00 pm.
Reply With Quote  
Join Date: Oct 2006
Location: India
Posts: 1,289
Reputation: vishesh is on a distinguished road 
Rep Power: 4
Solved Threads: 32
vishesh's Avatar
vishesh vishesh is offline Offline
Nearly a Posting Virtuoso

Re: Directory Structure/No Index file?

  #4  
Oct 9th, 2007
Well, the root directory consists of several sub-directories.

Now suppose you goto 'http://www.xyz.com/dir'. The server you are using gives an option to set the default page(normally index.html or index.html), in each directory.

So of course portfolio is a folder, with files related to it, like index.html the default page. Index.html is the default web page. So whether you write 'http://www.xyz.com/dir' or 'http://www.xyz.com/dir/index.html', it makes no difference.

But note that although index.html is frequently used default, so it won't mean that its so in every case. Someone would have set it as 'home.htm' or anything else.
Reply With Quote  
Join Date: Oct 2007
Posts: 4
Reputation: EthanB is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
EthanB EthanB is offline Offline
Newbie Poster

Re: Directory Structure/No Index file?

  #5  
Oct 9th, 2007
Ah... I get it now. Thanks for your help!

Although, why would "ThisCan'tWork.ItWon't" work as well? I'm guessing it's because I started in the portfolio folder and from there appended the "ThisCan'tWork.ItWon't". And since that page doesn't exist, the server simply reverts to using the default page? Could this be a simple server configuration again?
Reply With Quote  
Join Date: Jan 2007
Posts: 2,510
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 103
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Directory Structure/No Index file?

  #6  
Oct 13th, 2007
The home page name for a given server is set by the server administrator, not by you. It will be the same filename for all websites on that server. For example, geocities.com has set all of the website home pages to be "index.html", with "index.htm" also working. On the other hand, my former ISP company used "home.htm" as the default name.

You must use the server's default name as your home page filename, if you want people to be able to address your site without appending a filename to the end of the url.

Other filenames must be addressed by adding the filename to the url, e.g:
http://mysite.myserver.net/myfilename.htm

The extension of a web page MUST be .htm or .html - nothing else will open your browser to display it. You don't get to pick your own extensions. They tell the computers involved what kind of file the file is, and what application the browser should open it with.

.htm and .html are web pages.
.gif is an image
.jpg is an image
.doc is a Word document
.ItWont is not associated with any application, so it won't display. It will cause an error box to pop up.

You also have to tell the browser and server where to look for the file, if it is not in your site's top-level folder. If your page is stored in the myfolder folder, then the url would have to be:
http://mysite.myserver.net/myfolder/myfilename.htm

The server can't guess what you want it to do. You have to tell it where stuff is when you specify the url. And the file extension tells the browser what kind of stuff the file is.
Last edited by MidiMagic : Oct 13th, 2007 at 4:36 pm.
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Oct 2006
Location: India
Posts: 1,289
Reputation: vishesh is on a distinguished road 
Rep Power: 4
Solved Threads: 32
vishesh's Avatar
vishesh vishesh is offline Offline
Nearly a Posting Virtuoso

Re: Directory Structure/No Index file?

  #7  
Oct 14th, 2007
> The extension of a web page MUST be .htm or .html - nothing else will open your browser to display it

Perhaps it could be asp, php, aspx etc etc too.
Reply With Quote  
Join Date: Jan 2007
Posts: 2,510
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 103
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Directory Structure/No Index file?

  #8  
Oct 15th, 2007
Originally Posted by vishesh View Post
> The extension of a web page MUST be .htm or .html - nothing else will open your browser to display it

Perhaps it could be asp, php, aspx etc etc too.


I was trying to keep it simple.
Daylight-saving time uses more gasoline
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Site Layout and Usability Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Site Layout and Usability Forum

All times are GMT -4. The time now is 7:58 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC