PDA

View Full Version : Using underscores in URLs?


illumini
01-08-2007, 10:37 PM
I've just been told by a work colleague when stying CSS to avoid using '_' and instead use a parent-child set. eg. contentContainerHeader as opposed to content_containerHeader. Is this correct?

Also, when naming static files, modules, etc. to avoid using the '-' (dash) character as some web servers don't support it. I host several WordPress installs which all use '-' within their slugs. Again, is this correct?

Cheers! :)

mcanerin
01-09-2007, 03:08 AM
I'll leave the CSS question to the CSS mavens, but I can answer the dash one.

Dashes are good.

What? You want more? Ok. Traditionally, *nix users used the underscore because you could not use spaces at the command prompt unless they were in quotes, else it confused things. Since the underscore looked almost like a space but was a hard character, most *nix types started using it as if it was a space, and it became a tradition.

That tradition spilled over to programmers, who began to use it for the same reasons.

Later, when programmers working on *nix boxes created search engines, they wanted to use that search engine to find things they needed to do their job. It turns out that if you treat an underscore in a search engine as a space, then you have a really hard time looking for code snippets.

Therefore, search engines treated the underscore as a hard character. Dashes, however, were treated as a space character because it didn't mess up the searches the programmers did.

I've never heard of a webserver that didn't support the dash. Ever. I just went looking to be sure and still didn't find any reference at all.

The closest 2 issues I've come across was that 1) ASCII treated the hyphen and the minus sign as the same thing, but Unicode treats them differently. However, the Unicode is backwards compatible with ASCII for this, so no problems there. 2) some programs that run on a webserver can treat a double dash -- differently.

Neither of these have any effect at all on the naming of files with a dash.

For SEO purposes, it's better to use a dash as a separator than an underscore since "cheap-ringtones" is treated as "cheap ringtones" but "cheap_ringtones" is treated as a nonsense word.

Ian

illumini
01-09-2007, 03:11 AM
I spoke to my colleague again, he mentioned issues with UNIX systems. Your explanation backs this up. So dashes it is, this'll be passed onto the dev and creative pool here at work. :D

Thanks!

webmaster
01-14-2007, 02:27 PM
It turns out that if you treat an underscore in a search engine as a space, then you have a really hard time looking for code snippets.


Why? I can think of quite a few ways to handle this, and I'm sure the folks working at Google, etc. could too. If foo_bar is broken up and indexed as two adjacent words, and I search for foo_bar, my query can be converted into "foo bar", and still find the foo_bar instance. Or the simple proximity of foo and bar in my query and on the page could probably solve the issue. Or...

If Google can automatically find the plural form of your search terms, I'm fairly sure they can manage to surmount the underscore issue.


For SEO purposes, it's better to use a dash as a separator than an underscore since "cheap-ringtones" is treated as "cheap ringtones" but "cheap_ringtones" is treated as a nonsense word.


Do you have any evidence that using underscores in URLs has hurt digg.com? Do you have any evidence that using underscores has hurt any site?

Added: Wikipedia also uses underscores in their URLs. Did they get it wrong too?

jamesh3
04-22-2007, 10:01 PM
underscore versus minus sign debate is a bit old now.
Search google for memory usage firefox (http://www.google.com/search?num=100&hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=2d6&q=memory+usage+firefox&btnG=Search) brings up plenty of underscore urls at the top including digg.com. There are so many other factors that go into why a page is higher than another, that it seems the underscore vs minus sign has a very low weighting in the matter. And the whole argument that google can not see underscore as a space ... give me a break. Google can conquer the world but is brought to a screaming halt by the humble underscore? Now that is a modern Achilles heel!
One could also argue that using minus signs could get a google penalty !! Look at all the 101 seo articles on the web that spammers use. Use minus signs in urls, is always on the list. So spammers use every keyword + minus sign in their urls. This must be figuring in google's fight on spam. So using minus signs in your url could be negative or neutral seo. While using underscore could get you a higher page result because googles thinking no spammer is going to use underscore because everyone says not to do it.
Add to the mix that underscore appears to read better. Are the words easier to read with underscores? If so, the page gets a better click through. And word is google is looking at this type of information to filter out spam.

Is-it-more-important-to-have-a-URL-that-is-clear-and-people-will-click-on (http://)

Is_it_more_important_to_have_a_URL_that_is_clear_a nd_people_will_click_on (http://)

Which URL is easier to read and which one would you click on?

BuckfastMonk
04-26-2007, 10:14 AM
Which url is easier to read? lol

Looks like you don't even know what a url is. ah your post looked so promising . . . :rolleyes:

jamesh3
04-26-2007, 06:26 PM
Yeah yeah very funny (you know what I'm talking about) - I'm meant urls, links, filenames and keywords - you caught me out, I'm a businessman not a professional SEO. Then again if I was an insider or seo professional I would not be posting my experiences on a forum for free. ;)
Google brings me traffic, Google doesn't pay my bills. It is all about the customer. If your customers stop using google would you care where you rank on google?
Links and words are easier to read with underscores. I think they get a better click through on my website. Google understands underscore is a space. There is too much of it out there for them to ignore. Google wants to index the web not impose it rules on the web. If underscores are out there, Google was always going to modify their secret sauce to see underscore as a space.

Does it still make you laugh ryanmcmaster? :D If so explain.

beu
04-26-2007, 06:48 PM
Do you have any evidence that using underscores has hurt any site?

Added: Wikipedia also uses underscores in their URLs. Did they get it wrong too?

I don't know of evidence to suggest underscores hurt sites but, hyphens are better than underscores especially if your keyword target is a plural. In addition, I don't know if I would base my SEO tactics on what seems to be working for Wikipedia.

BuckfastMonk
04-27-2007, 05:01 AM
Yes I am still laughing

Then again if I was an insider or seo professional I would not be posting my experiences on a forum for free. ;)

Well the beauty of SEW is that most people here contribute good advice and are willing to share what they have been learning.


Google brings me traffic, Google doesn't pay my bills. It is all about the customer. If your customers stop using google would you care where you rank on google?


No of course I would not care. Until that day (when its cold in hell) google continue to pay my bills, I dont know about you.


Links and words are easier to read with underscores. I think they get a better click through on my website.


You think?


Google wants to index the web not impose it rules on the web.


Really? Why not climb out from under that rock you have obviously been hiding under