homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / WebmasterWorld / Accessibility and Usability
Forum Library, Charter, Moderators: ergophobe

Accessibility and Usability Forum

Using directories vs file names

5+ Year Member

Msg#: 77 posted 11:33 am on Jun 2, 2006 (gmt 0)

Lately I've been obsessed with building logical dir structures for my websites. Not just with the SEs in mind, but also for better organizing my content. I must say that for years I've only created websites of the type example.com/file.html with no directories at all.

For this site I'm working on, if I follow strict dir structure rules the site will look something like this:



I have 2 concerns/questions here:

Dir1 and dir2 must be created just for building an "a la carte" structure, so they only contain the index.html file. Is this viewed as a good, non spammy practice (having empty directories)?

In addition the Dir111 and dir222 type directories also contain only the index.html files. There are about 400 of these and they are my content pages. I thought it might be better to use dir/ instead of files.html because in the future I might add more pages to these directories. Also, I might change file extensions someday.

In conclusion, to me using this structure containing only directories seems better as a long term solution, and from a correct website structuring point of view. But am I not unnecessarily complicating things? Thanks for your advice.



5+ Year Member

Msg#: 77 posted 12:13 pm on Jun 2, 2006 (gmt 0)

If you give the directories meaningful names, a structure like that will be very userfriendly because the URL shows how each page fits into the structure. Your problem is that some URLs may grow rather long which may be a handicap in some search engines.

I have never had problems with search engines because I had directories with only an index page.


5+ Year Member

Msg#: 77 posted 3:26 pm on Jun 2, 2006 (gmt 0)

Thanks. The reason I was concerned is because I don't see many directories ranking in Google. But I suppose not many people use them this way.


WebmasterWorld Administrator buckworks us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 77 posted 3:43 pm on Jun 2, 2006 (gmt 0)

Another advantage is that a URL like this:


has fewer characters than this:


If you have a lot of internal cross-linking the saving can add up to hundreds of characters per page. That's A Good Thing in every way I can think of.


WebmasterWorld Senior Member pageoneresults us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 77 posted 3:46 pm on Jun 2, 2006 (gmt 0)

The future is extensionless! Content Negotiation.


WebmasterWorld Senior Member encyclo us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 77 posted 5:15 pm on Jun 2, 2006 (gmt 0)

Your biggest problem is maintaining a structure of dozens or hundreds of files all called "index.html". It becomes unmanageable after a while. If I'm building a static site I split the content into categories and use appropriate file names for each page within those directories with a .htm or .html extension. If the site is small, I simply put all the files in root.

For a dynamic site, I use mod_rewrite to create extensionless URLs from the variables - for example:


relates to two variables "category" and "page".

The problem with extensionless URLs is that you need to check how the server handles the presence or absence of the trailing slash - which should always be present when using physical directories. Yahoo, for example, lists such links without the trailing slash, forcing a 301 redirect to the correct page. Pages with extensions (best to always stick to generic extensions such as .html rather than .asp or .php) at least have the benefit of being absolutely clear. Don't forget that 99.99% of visitors will never look at the URL structure at all - it offers almost no real-world aid to usability except for type-ins.

As pageoneresults mentions, Content Negotiation is the way forward, but it is often not available by default on shared servers. This allows you to use standard files server-side but refer to them without extensions - the server will serve the most appropriate file dependent on different factors. For example you could have two index files:


And the content negotiation would serve the page in English or French dependent on the language preferences defined in the user's browser - all this under the same URL: http://www.example.com/page


5+ Year Member

Msg#: 77 posted 6:10 pm on Jun 2, 2006 (gmt 0)

Thanks for the thorough explanation Encyclo. I had no idea what Content Negotiation was.


WebmasterWorld Administrator coopster us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 77 posted 9:31 pm on Jun 2, 2006 (gmt 0)

It's certainly something worth learning.

Content Negotiation [httpd.apache.org]
Content Negotiation: why it is useful, and how to make it work [w3.org]


WebmasterWorld Senior Member annej us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 77 posted 12:50 am on Jun 3, 2006 (gmt 0)

My top page that gets almost all of my visitors and earnings is the index page of a subdirectory.

It's the links and other factors in the algo that gets it there, not wheter it is the root page or the main subdirectory page. And yes, I like the way I can give each subdirectory a name that specifically describes what is contained there.

I have to have subdirectories just to organize my site as well. You do have to be careful you don't put the wrong index page in the wrong directory. Always check after you upload.

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / Accessibility and Usability
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved