Welcome to WebmasterWorld Guest from

Forum Moderators: ergophobe

Message Too Old, No Replies

Using directories vs file names


11:33 am on Jun 2, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:May 18, 2005
votes: 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.

12:13 pm on June 2, 2006 (gmt 0)

New User

10+ Year Member

joined:Sept 14, 2005
votes: 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.

3:26 pm on June 2, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:May 18, 2005
votes: 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.
3:43 pm on June 2, 2006 (gmt 0)


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

joined:Dec 9, 2001
votes: 28

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.

3:46 pm on June 2, 2006 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 27, 2001
votes: 55

The future is extensionless! Content Negotiation.
5:15 pm on June 2, 2006 (gmt 0)

Senior Member from CA 

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

joined:Aug 31, 2003
votes: 4

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:

6:10 pm on June 2, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:May 18, 2005
votes: 0

Thanks for the thorough explanation Encyclo. I had no idea what Content Negotiation was.
9:31 pm on June 2, 2006 (gmt 0)


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

joined:July 31, 2003
votes: 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]

12:50 am on June 3, 2006 (gmt 0)

Senior Member

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

joined:Feb 17, 2002
votes: 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.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members