Can directory have multiple words?

Is it okay to have a directory made up of several words?

For example…


current-event

case-studies

in-the-news

Debbie

Sure, why not? And what happened when you tried?

Debbie,

Now, that surprises me coming from you as I know that you know better! For everyone else, Sir Tim Berners-Lee’s treatise on URI syntax is a geek’s guide to allowable characters (and, Deb, a space in a directory name would NOT be allowed - unless it’s encoded as %20): http://www.ietf.org/rfc/rfc2396.txt.

Regards,

DK

Well, I know it is okay - and preferred - to use hyphens in file names (e.g. “postage-meters-can-save-you-money.php”) but I did not know whether that same logic was acceptable for directory names?!

So it sounds like a URL like this would both be acceptable and good for SEO purposes…

www.mysite.com/articles/small-business/postage-meters-can-save-you-money.php

Right?

Thanks,

Debbie

I can’t think of a reason why it wouldn’t be :slight_smile:

Like ScallioXTX asked:

Sure, why not? And what happened when you tried?

DD,

Personally, I prefer underscores (_'s) rather than hyphens (-'s) because the words stand out more. As a mod_rewrite user, it’s also easier to deal with _'s than -'s.

Did you bother to read the Berners-Lee article? It’s techno-geek but very enlightening (at least for those with problems putting :'s, etc, in a URI).

Then, I’ll add my echo of Rémon’s query about what happened when you tried ‘odd’ directory names.

Regards,

DK

The downside of underscores is the human element - when people are typing a URL in. It’s much easier to see the word delimiter in domain.com/multiple-words than domain.com/multiple_words, and it’s easier to get people to type a dash than an underscore as well.

Stevie,

True - if you’re relying on visitors typing in the URI. However, in the world of mod_rewrite, hyphens do occur naturally and using them to replace spaces makes a horrible mess of redirections. It’s a personal preference and there’s a downside to either depending largely what the needs are, i.e. links vs typos and mod_rewrite redirections vs no redirections. I’m sure that others will find other reasons for one or the other - which might make for an interesting thread.

Regards,

DK

Except Google prefers hyphens… (At least for file names.)

Did you bother to read the Berners-Lee article? It’s techno-geek but very enlightening (at least for those with problems putting :'s, etc, in a URI).

It is 40 pages, so no. But I did skim the section on valid characters. And I did PDF it and put it in my “References” folder for later reading.

Then, I’ll add my echo of Rémon’s query about what happened when you tried ‘odd’ directory names.

Regards,

DK

I didn’t notice any issues with hyphens in directory names, but that doesn’t mean you’d want to do that.

Debbie