9 replies [Last post]
zerimar3
Offline
Regular
Last seen: 12 years 6 weeks ago
Joined: 2004-04-23
Posts: 19
Points: 0

Okay,

I'm still a new jack, what can I say. But I've visited sites like zeldman.com and happycog along with a list apart and I'm wondering why it is that when I navigate. The pages have the site address but not the html extension.

They only have /about/ for the "about" page or /contact/ for the "contact" page and so on. It's not like about.html or contact.html.

Is there a way the file should be saved for this or is it a different way of coding?

Any help would be appreciated as I see this as my mystery hunt.

Cheers!

Tags:
Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Web pages with no html extension......???

Hi there
They are using good directory structure rather than lumping everything in one. If you address in the form of somesite.com/ the forward slash says to load the default file for that directory as will somesite.com/directory1/ each time index.html index.php etc are loaded. They are in effect subsections of the site with their own index pages. It's supposed to be usefull in many ways ; neater site structure, better for search engines, usefull for breadcrumb trails your internal site links are simpler href="/" should always take back to the top level index page of your site.
Having said all that just found this link which explains better than I,

http://webtips.dan.info/subdir.html

Hope that helps,

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

zerimar3
Offline
Regular
Last seen: 12 years 6 weeks ago
Joined: 2004-04-23
Posts: 19
Points: 0

Web pages with no html extension......???

Hugo,

Thank you so much for your reply. You and my brother share the same name. Your explanation makes sense, I just need to take time to let it register. On another note, could you expand on "breadcrumbs" I see them from time to time, is that something to do with a sub navigation of some sort?

Thank you once again, and I'll be reading that article you posted as well with the link. Take care and I hope to hear from you soon.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Web pages with no html extension......???

Glad it helped although the link will explain far better than my addled mind!

Breadcrumb trails are really quite cool they are a form of secondery site navigation most usefull where you have a site with lots of pages and directories and where it's quite easy to loose your way.
They allow for a trail to be displayed (generally at the top of the page in smallish type) taking the form of say home page > directory1 > directory2 > thispage.html all as clickable links so you can follow your route back from whence you came! They are either hancoded or scripted with something like PHP which dynamically works the links out.

Hugo.

Congrats to your brother on a cool name Smile

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

zerimar3
Offline
Regular
Last seen: 12 years 6 weeks ago
Joined: 2004-04-23
Posts: 19
Points: 0

Web pages with no html extension......???

Hugo,

Thanks once again for your explanation. I thought that's what breadcrumbs were, and I really like the way you explained it. I'm not really the techy type, I'm more into graphics, but your way of putting it is clean and to the point. Thank you once again, and I'll be sure to pass the compliment to my brother about the cool name.

Cheers! Smile

Oh yeah, one more thing, on the subdirectories, which apparently are now called folders. Do you create a folder for each page and load it or how is the structure formed. I read the article you sent and it makes a bit more sense, so do I create an "about" folder/subdirectory and use it as I would a homepage which is "index" or how would I do that?

Thanks once again for your time.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Web pages with no html extension......???

Directories is still the correct term for subdivided areas on a hard drive it was Microsoft that decided to try to rename these to folders there seems to be a split between people new to computing that have only used MS products and those from a Linux/unix apache environment who think it proper to call them directories .we could do without MS trying to re-invent things that are established!!

The structure is much the same as your own HD you have your main directory which on apache would be public_html in which would live your home page/index.html you can then create as many further directories as you wish, then look on them as containing a set of related pages, so your main page would have a link on it to services which would reference another index.html residing in the directory 'services' then all pages relating to services can go in here as well,if for no other reason it keps your main directory uncluttered ( we don't dump everything in one directory on our own machines, it would be a mess!!)

So it's not a directory for each page but rather a directory containing related pages with their own index page.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

zerimar3
Offline
Regular
Last seen: 12 years 6 weeks ago
Joined: 2004-04-23
Posts: 19
Points: 0

Web pages with no html extension......???

Hugo wrote:

The structure is much the same as your own HD you have your main directory which on apache would be public_html in which would live your home page/index.html you can then create as many further directories as you wish, then look on them as containing a set of related pages, so your main page would have a link on it to services which would reference another index.html residing in the directory 'services' then all pages relating to services can go in here as well...So it's not a directory for each page but rather a directory containing related pages with their own index page.

Hugo.

Hugo, Thank you once again for your reply, but where I get lost is in the creating of index.html residing in other directories. Is this the regular index I use for a home page that goes into each directory? Is each directory simply another folder within the primary wwww?

I was getting it a bit but now it seems that I'm losing the grasp of the concept. Is there any way you could show me visually what you mean? I'm just lost on that index part and creating directories and putting more files in each directory.

So let's say I have "about us" as a directory. In there I can put "history" and/or "how it all began" or "who we are" type of files? And the index that goes in there, is it the regular index that is used for the home page?

I know I'm probably not making sense and I apologize for the bother but I'm really trying to grasp this to learn. Thank you once again for your time and explanations.

Regards

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Web pages with no html extension......???

I can see that's it's confusing, for a start it's best to grasp the context of the 'index.html' file the word index is used as it is generally the file name that a server will deliver when you type in a straight address such as www.foo.com/ doing this you haven't actually specified a file name to open so the server will send you the default file name that is set up on the server which is nearly allways index.html( but can be start.html and poss others). If no default file exists then the server will return an error page or a file index of the contents of that directory (if indexing hasn't been turned off)

So the purpose of the 'index file' is really to ensure that a page is returned when an address is typed in, a page that you determin, which is generally the 'home page' of your site. So try not to think of it as an index but just your start page.

another way of looking at it would be to say that if there was no page automatically returned from the server upon request you would have to know the page you wanted whenever you typed an address such as www.foo.com/homepage.htm which is fine if you know the file names on a site but difficult if you don't.
Now the thing with sub directories is that they too can serve up a default file name, again index.html but this is not the same page this is a distinct file. if you were creating a site, you wrote your home page called it index.html and that home page has a link to aboutus.html you could decide that as there were going to be further pages on this theme that they would be better of in their own directory so you create a new directory called 'about' within the public_html directory (which is the root or top level of your public site) in this new directory you put all the pages you create on this theme and you would rename aboutus.html to index.html (still the same file contents) but now your link to this page from the main page looks like <a href="about/"> instead of <a href="aboutus.html"> using the forward slash at the end tells the server to look in the directory for a default index.html file.

Things to remember are that if you are developing your pages localy on your machine you will need to set up the same directory structure as you will have on the remote server ( which is good practise anyway) as you can't have two files with the same name!! in the same directory and that you don't have to do any of this all files can live in the www/public directory quite happily

so yes the sub directories/folders are created within the www/public_html folder
The reason for the name 'index.html' is that a server will be set up to serve files with that name if one exists in a directory/folder automatically ( this is also another way of ensuring that people can't get to see a listing of all the files that live in a directory/folder as the index.html is always served up if a directory is typed rather than file name).
You put whatever files you wish in each folder with or without an index.html it just means that your href links are neater.

Not sure if that makes it any clearer if not just post back and I'll try again - not a problem.

Regards,

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

zerimar3
Offline
Regular
Last seen: 12 years 6 weeks ago
Joined: 2004-04-23
Posts: 19
Points: 0

Web pages with no html extension......???

Hugo wrote:

Now the thing with sub directories is that they too can serve up a default file name, again index.html but this is not the same page this is a distinct file. if you were creating a site, you wrote your home page called it index.html and that home page has a link to aboutus.html you could decide that as there were going to be further pages on this theme that they would be better of in their own directory so you create a new directory called 'about' within the public_html directory (which is the root or top level of your public site) in this new directory you put all the pages you create on this theme and you would rename aboutus.html to index.html (still the same file contents) but now your link to this page from the main page looks like <a href="about/"> instead of <a href="aboutus.html"> using the forward slash at the end tells the server to look in the directory for a default index.html file.

so yes the sub directories/folders are created within the www/public_html folder
The reason for the name 'index.html' is that a server will be set up to serve files with that name if one exists in a directory/folder automatically ( this is also another way of ensuring that people can't get to see a listing of all the files that live in a directory/folder as the index.html is always served up if a directory is typed rather than file name).
You put whatever files you wish in each folder with or without an index.html it just means that your href links are neater.

Not sure if that makes it any clearer if not just post back and I'll try again - not a problem.

Regards,

Hugo.

Hugo,

You are the man my friend! I read it, I tried it and it works!!!!!! YEAH! So all I did was to create a folder/directory in the root. And the "about" file is an index.file in the "about" folder right? Just double checking.

Thank you so much for your explanation. If there's anything I can do for you, let me know, but I'm sure you know more than I. But thank you very much my friend, it is highly appreciated...thank you very much.

Cheers! Smile

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Web pages with no html extension......???

You've got it ,
glad it made sense, it easier than one thinks it's often just about ordering things in ones head in a way that is understandable. this method of using sub directories to structure the site is also regarded as better for the purposes of search engines as you provide a clearer url with names that match keywords etc for them to index and now you can link back up your directories with simple
<a href="../"> which will always take you up a level back towards root level finding the index.html in each directory.

Happy learning

Hugo.

oops just dawned on me this topic has been posted in 'Common Questions' a mod may like to move it out ?

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me