dashes vs. underscores in filenames

In the old days of the web, file names usually didn't go out of their way to convey information about their contents. If the page was about dogs, sure, it might have been "dogs.html", but if it was "Care and feeding of poodles", it was more likely to be "poodles.html" than anything else.

That's all changed. The conventional wisdom nowadays is that search engines pay attention to file names as part of their analysis, so that poodle page is probably "care-and-feeding-of-poodles.html" now.

That brings up a question, though: should it be "care-and-feeding-of-poodles.html" (dashes) or "care_and_feeding_of_poodles.html" (underscores)? A Google search for "dashes vs. underscores" will tell you that dashes are the smart choice, but I didn't find any place that tells you why.

One hint might be found in Perl regular expressions. If you use "/w" in a Perl expression, that matches alphanumeric characters plus "_". The "/w" is often used to break up sentences into words. So "hello-there" is two words if "/w" is used, but "hello_there" is only one. I'm not saying Google or any other search engine uses Perl to parse your pages (though they might), but Perl got the idea of "_" being part of a word from long established practice. So, if you want search engines to "see" separate words, you should probably use dashes.


There is another point to consider, though: "care-and-feeding-of-poodles.html" is a lot of typing, and although most passing of links is down by cut and paste rather than word of mouth, length and difficulty may be something to think about. I think I'd probably make that "poodle-care.html". There is also speculation that search engines may penalize you for too many dashes in a link because it starts looking like spam: "lets-cram-every-keyword-we-can-into-this-link.html".

So, use dashes and keep it shorter rather than longer.


Technorati tags:









-
Google Friend Connect users can
comment on this page here


Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner

cartoon
My Unix and Linux Troubleshooting E-Book will show you how to
solve tough system problems!


Views for this page
Today This Week This Month This Year  Overall
120181,297 2,227

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

pavatar.jpg
More:
       - Web/HTML
       - Blogging




Unix/Linux Consultants


larryi@ccamedical.com SCO OS5, Debian Linux, RedHat Linux, MySQL, Apache, AJAX development using dXport/dL4/Unibasic, Windows Connectivity, Sharing Resouces, Automation, Shell Scripting


http://bcstechnology.net Full service Linux & UNIX systems integrator; Windows to UNIX/Linux Client-Server Specialist; Secure E-Mail & Website Hosting; Thoroughbred Software Developer; Custom Industrial Automation; Hardware & Electronics Experts; In Business Since 1985.


http://www.schewanick.com SCO Unix, Solaris, Linx (various), PHP, MySQL, Apache, uniBasic, dL4, Perl, System Administration and more....



Twitter
  • Dec 3 14:01
    Just went out and added more bungee reinforcement. That ought to hold it..
  • Dec 3 13:58
    I'm second guessing myself on how I bungeed the cover on my golf cart for winter storage. Wondering if high wind could rip it off..









Change Congress