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:



Comments /foo-web/dash-vs-underscore.html




Add your comments

ad

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


Views for this page
Today This Week This Month This Year  Overall
625113726 1,656

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

Your ad here - $24.00 yearly!

SCO, OpenServer, UnixWare, software, servers, security, networks, installation, administration, troubleshooting, maintenance, Watchguard, firewalls, VPNs, e-mail. Visit us at http://opensystemscomputing.com and www.go2unix.com.


http://www.breakthru.com.au SCO (Openserver and Unixware), Unix, Solaris and Linux Consulting services including: Secure Networking Solutions; Linux based Firewalls; Backup Solutions; Secure Home to Office Network Setup; Phone, Remote and On-Site Support available - Satisfaction Guaranteed!


http://www.cleverminds.net Need expert advice? Want a second opinion? CleverMinds is a one-stop-shop for a wide range of technology solutions. We support Unix, Linux, SCO as well as CMS, ecom, blogs, podcasts, search engines consulting and more. Contact us at web2.0@cleverminds.net 0r (617) 894-1282









Change Congress

Related Posts