Welcome to WebmasterWorld Guest from 184.108.40.206
Forum Moderators: ergophobe
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.
I have never had problems with search engines because I had directories with only an index page.
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:
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.