dashes in URLs

Discussion in 'HTML' started by j, Jan 16, 2013.

  1. j

    j Guest

    The preferred method of replacing spaces in URLs is with a dash for
    SEO. So, a while back, I switched over from underscores.

    Now, I have a product that naturally has a "-" in it. Not that I
    couldn't see this coming, but I don't make the "rules".

    What do I replace a - with? URL encoding is no help because %2D gets
    converted back to a - before the software gets a hold of it.

    And just why are "-" so great for SEO?

    Jeff
    j, Jan 16, 2013
    #1
    1. Advertising

  2. 2013-01-16 10:49, j wrote:

    > The preferred method of replacing spaces in URLs is with a dash for
    > SEO.


    Virtually everything you have read about "SEO" is a mix of hearsay and
    speculation. You seem to propagate the cargo cult tradition well.

    > So, a while back, I switched over from underscores.


    And the odds are that you just destroyed much of your "SEO" rating if
    you had any, because you probably did not redirect the old addresses.
    Few sites do that, partly because it usually means a lot of work.

    And you probably can't undo that. Once your old URLs have been removed,
    as 404 Not Found, from search engine databases, you might be able to get
    them back in some months, but they will most probably appear as new
    URLs, so they start from the bottom. In "SEO", you can fake many things,
    but not age.

    > Now, I have a product that naturally has a "-" in it. Not that I
    > couldn't see this coming, but I don't make the "rules".
    >
    > What do I replace a - with?


    How about the Unicode HYPHEN U+2010? Not that it would be such a great
    idea, but it would be different from HYPHEN-MINUS U+002D, and this seems
    to be the immediate requirement. And it will make typing the URL almost
    mission impossible to most users, but who cares about such things when
    you have SEO to believe in?

    > And just why are "-" so great for SEO?


    You are asking that *now*?

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Jan 16, 2013
    #2
    1. Advertising

  3. j

    j Guest

    On 1/16/2013 4:03 AM, Jukka K. Korpela wrote:
    > 2013-01-16 10:49, j wrote:
    >
    >> The preferred method of replacing spaces in URLs is with a dash for
    >> SEO.

    >
    > Virtually everything you have read about "SEO" is a mix of hearsay and
    > speculation. You seem to propagate the cargo cult tradition well.


    I have no opinion about SEO, it's not what I do. I was informed that SEO
    order of preference is -,+ and then _ trailing badly. This was paid for
    advice, not by myself, but by the site owner.

    If you look at URLs for major sites you see that "-" is ubiquitous. It
    is the way it is done.
    >
    >> So, a while back, I switched over from underscores.

    >
    > And the odds are that you just destroyed much of your "SEO" rating if
    > you had any, because you probably did not redirect the old addresses.
    > Few sites do that, partly because it usually means a lot of work.


    These were all set up as 301 in the .htaccess.
    >
    > And you probably can't undo that. Once your old URLs have been removed,
    > as 404 Not Found, from search engine databases, you might be able to get
    > them back in some months, but they will most probably appear as new
    > URLs, so they start from the bottom. In "SEO", you can fake many things,
    > but not age.


    I just checked the site on Google for some common keywords and it seemed
    to do rather well. Not the top listing but page one and two.
    >
    >> Now, I have a product that naturally has a "-" in it. Not that I
    >> couldn't see this coming, but I don't make the "rules".
    >>
    >> What do I replace a - with?

    >
    > How about the Unicode HYPHEN U+2010? Not that it would be such a great
    > idea, but it would be different from HYPHEN-MINUS U+002D, and this seems
    > to be the immediate requirement. And it will make typing the URL almost
    > mission impossible to most users, but who cares about such things when
    > you have SEO to believe in?


    Few people type in URLs for products.

    >
    >> And just why are "-" so great for SEO?

    >
    > You are asking that *now*?


    Because I'd like to know.

    Jeff
    >
    j, Jan 16, 2013
    #3
  4. 2013-01-16 14:14, j wrote:

    > On 1/16/2013 4:03 AM, Jukka K. Korpela wrote:
    >> 2013-01-16 10:49, j wrote:
    >>
    >>> The preferred method of replacing spaces in URLs is with a dash for
    >>> SEO.

    >>
    >> Virtually everything you have read about "SEO" is a mix of hearsay and
    >> speculation. You seem to propagate the cargo cult tradition well.

    >
    > I have no opinion about SEO, it's not what I do. I was informed that SEO
    > order of preference is -,+ and then _ trailing badly. This was paid for
    > advice, not by myself, but by the site owner.


    So it indeed is cargo cult "information".

    > If you look at URLs for major sites you see that "-" is ubiquitous. It
    > is the way it is done.


    Using "-" is just a simple way. You can't use a space (except as
    %-encoded, which looks bad), so what *can* you use?

    Do you think Wikipedia is not a "major site"? Does it rank badly in
    search engines? Anyway, they use underline characters "_", as in
    http://en.wikipedia.org/wiki/Search_engine_optimization

    > These were all set up as 301 in the .htaccess.


    Fine, so you did the wrong thing (useless change of URLs) the right way,
    minimizing the damage. Most people don't do that. I know of rather few
    major site reorganizations that handled the redirection right.

    >>> And just why are "-" so great for SEO?

    >>
    >> You are asking that *now*?

    >
    > Because I'd like to know.


    Your client or boss paid for the advice, and now you are asking for
    better advice (that is, advice backed up with facts and arguments) for free.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Jan 16, 2013
    #4
  5. j

    Lewis Guest

    In message <kd5pjh$7u7$>
    j <> wrote:
    > The preferred method of replacing spaces in URLs is with a dash for
    > SEO. So, a while back, I switched over from underscores.


    > Now, I have a product that naturally has a "-" in it. Not that I
    > couldn't see this coming, but I don't make the "rules".


    > What do I replace a - with? URL encoding is no help because %2D gets
    > converted back to a - before the software gets a hold of it.


    Why do you replace it at all?

    > And just why are "-" so great for SEO?


    Because -'s are word boundaries and _'s are not.

    --
    She floats like a swan
    Grace on the water
    Lewis, Jan 16, 2013
    #5
  6. On Wed, 16 Jan 2013 13:22:55 +0000 (UTC), Lewis
    <> wrote:

    [snip]

    >Because -'s are word boundaries and _'s are not.


    Huh?

    In "co-ordinate", "-" is not a word boundary. "_" is often used
    for emphasis, like this: _like this_. Can you show me a *word* that
    contains "_"?

    Sincerely,

    Gene Wirchenko
    Gene Wirchenko, Jan 16, 2013
    #6
  7. j

    Lewis Guest

    In message <>
    Gene Wirchenko <> wrote:
    > On Wed, 16 Jan 2013 13:22:55 +0000 (UTC), Lewis
    > <> wrote:


    > [snip]


    >>Because -'s are word boundaries and _'s are not.


    > Huh?


    > In "co-ordinate", "-" is not a word boundary. "_" is often used
    > for emphasis, like this: _like this_. Can you show me a *word* that
    > contains "_"?


    That's nice. We're not talking about English, we are talking abut parsing URLS.

    "This_is_one_word" to a computer, "this-is-not-one-word" to a computer.

    --
    Marriages made in heaven are not exported.
    Lewis, Jan 16, 2013
    #7
  8. Lewis wrote:
    > In message <>
    > Gene Wirchenko <> wrote:
    >> On Wed, 16 Jan 2013 13:22:55 +0000 (UTC), Lewis
    >> <> wrote:

    >
    >> [snip]

    >
    >>> Because -'s are word boundaries and _'s are not.

    >
    >> Huh?

    >
    >> In "co-ordinate", "-" is not a word boundary. "_" is often used
    >> for emphasis, like this: _like this_. Can you show me a *word* that
    >> contains "_"?

    >
    > That's nice. We're not talking about English, we are talking abut parsing URLS.
    >
    > "This_is_one_word" to a computer, "this-is-not-one-word" to a computer.
    >


    Please explain that assertion!

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Jan 16, 2013
    #8
  9. 2013-01-16 22:52, Lewis wrote:

    > "This_is_one_word" to a computer, "this-is-not-one-word" to a computer.


    That depends on what the computer has been programmed to do. There is
    little really reliable information of what search engines actually do.
    Since they primarily deal with text in human languages, it is natural to
    expect that "foo-bar" is taken as one word, though possibly as more or
    less synonymous with the word pair "foo bar", because many languages
    have hyphenated compound words. And since human languages do not use the
    underline "_", what should search engines do with "foo_bar"?

    But, fair enough, URLs may be an exception. Google says:

    "Consider using punctuation in your URLs. The URL
    http://www.example.com/green-dress.html is much more useful to us than
    http://www.example.com/greendress.html. We recommend that you use
    hyphens (-) instead of underscores (_) in your URLs."
    http://support.google.com/webmasters/bin/answer.py?hl=en&answer=76329

    They don't say why, and they don't say that underscores do something bad
    to search engines - even though this would be the right place to say
    such things.

    So, by all means, use foo-bar rather than foo_bar in URLs. But changing
    existing URLs is normally a bad idea.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Jan 16, 2013
    #9
  10. Jukka K. Korpela wrote:
    >
    > They don't say why, and they don't say that underscores do something bad
    > to search engines - even though this would be the right place to say
    > such things.


    I think the only reasons google and SEO "experts" advise dashes over
    underscores is 1) with the HTML link underline decoration the underscore
    is indistinguishable from a space, and 2) some newbies have no idea that
    that SHIFT + HYPHEN key is an underscore!

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Jan 16, 2013
    #10
  11. On Wed, 16 Jan 2013 03:49:41 -0500, j wrote:

    > The preferred method of replacing spaces in URLs is with a dash for SEO.


    Do you:

    1) Know this to be an absolute fact?

    2) Think this because someone you paid for advice told you so?

    3) Suspect this might be true because you heard it on the internet?

    4) Believe this because you worked it out yourself based on something you
    read somewhere?

    5) Have some other basis for this statement (and if so, what)?

    > ...........


    > And just why are "-" so great for SEO?


    You tell us. You just stated it as if it were a solid fact.

    --
    Denis McMahon,
    Denis McMahon, Jan 17, 2013
    #11
  12. On Wed, 16 Jan 2013 20:52:51 +0000 (UTC), Lewis
    <> wrote:

    >In message <>
    > Gene Wirchenko <> wrote:
    >> On Wed, 16 Jan 2013 13:22:55 +0000 (UTC), Lewis
    >> <> wrote:

    >
    >> [snip]

    >
    >>>Because -'s are word boundaries and _'s are not.

    >
    >> Huh?

    >
    >> In "co-ordinate", "-" is not a word boundary. "_" is often used
    >> for emphasis, like this: _like this_. Can you show me a *word* that
    >> contains "_"?

    >
    >That's nice. We're not talking about English, we are talking abut parsing URLS.


    Yes, I read the posts. URLs often have words in them, English
    words.

    >"This_is_one_word" to a computer, "this-is-not-one-word" to a computer.


    It depends on the language. For example, hyphens can be part of
    variable names in COBOL as can underlines.

    Sincerely,

    Gene Wirchenko
    Gene Wirchenko, Jan 17, 2013
    #12
  13. j

    j Guest

    On 1/16/2013 7:24 PM, Denis McMahon wrote:> On Wed, 16 Jan 2013 03:49:41
    -0500, j wrote:
    >
    >> The preferred method of replacing spaces in URLs is with a dash for SEO.

    >
    > Do you:
    >
    > 1) Know this to be an absolute fact?


    See below.
    >
    > 2) Think this because someone you paid for advice told you so?


    This is paid for advice (not by me). It is from someone who has been in
    the SEO business for years. I had no reason not to believe it and
    assumed until this thread that it was so. The dash usage is widespread,
    certainly it is preferred by many many webmasters.

    My own preference is an underscore, but what do I know? I have in fact
    modified the site software to use any delimiter specified, and I set the
    replacement as requested.
    >
    > 3) Suspect this might be true because you heard it on the internet?


    No.
    >
    > 4) Believe this because you worked it out yourself based on something you
    > read somewhere?
    >
    > 5) Have some other basis for this statement (and if so, what)?
    >
    >> ...........

    >
    >> And just why are "-" so great for SEO?

    >
    > You tell us. You just stated it as if it were a solid fact.


    No, I said it was the "preferred method", and just looking about would
    confirm that. Whether this actually affects SEO rankings I have not a clue.

    In fact, I have seen no proof either way, either that dashes improve
    ranking over underscores *or* that the don't. Do you have any proof?

    I should probably care more about this, but whenever I have occasion to
    post here, I lose desire to come back. What do we do here other than
    argue over pointless arcanity? I just want to move on...
    j, Jan 17, 2013
    #13
  14. j

    Lewis Guest

    In message <kd78h4$5fc$>
    Jukka K. Korpela <> wrote:
    > 2013-01-16 22:52, Lewis wrote:


    >> "This_is_one_word" to a computer, "this-is-not-one-word" to a computer.


    > That depends on what the computer has been programmed to do. There is
    > little really reliable information of what search engines actually do.
    > Since they primarily deal with text in human languages, it is natural to
    > expect that "foo-bar" is taken as one word, though possibly as more or
    > less synonymous with the word pair "foo bar", because many languages
    > have hyphenated compound words. And since human languages do not use the
    > underline "_", what should search engines do with "foo_bar"?


    The issue is that in computer languages, _ is not a word boundary
    character, so the theory for SEO goes that "search-term" sill be parsed
    properly and "search_term" will not.

    I am not saying this is how Google works. It IS how AltaVista worked last century.

    > But, fair enough, URLs may be an exception. Google says:


    > "Consider using punctuation in your URLs. The URL
    > http://www.example.com/green-dress.html is much more useful to us than
    > http://www.example.com/greendress.html. We recommend that you use
    > hyphens (-) instead of underscores (_) in your URLs."


    There you go.

    > http://support.google.com/webmasters/bin/answer.py?hl=en&answer=76329


    > They don't say why, and they don't say that underscores do something bad
    > to search engines - even though this would be the right place to say
    > such things.


    > So, by all means, use foo-bar rather than foo_bar in URLs. But changing
    > existing URLs is normally a bad idea.


    That too.

    --
    There's a race of men that don't fit in, A race that can't stay still So
    they break the hearts of kith and kin, And they roam the world at will.
    Lewis, Jan 17, 2013
    #14
  15. 2013-01-17 3:06, Gene Wirchenko wrote:

    >> "This_is_one_word" to a computer, "this-is-not-one-word" to a computer.

    >
    > It depends on the language. For example, hyphens can be part of
    > variable names in COBOL as can underlines.


    Or, to take a slightly more modern language, CSS. People often get
    confused with hyphenated CSS identifiers. They have "white space: no
    wrap" in their mind but can't remember whether it's "whitespace" or
    "white-space", "nowrap" or "no-wrap", or maybe "no wrap" (two values, as
    a CSS property may have) and then get frustrated when the correct answer
    is the seemingly inconsistent "white-space: nowrap".

    It's similar in human languages, too, especially in English - do I write
    "half-brother", "half brother", or "halfbrother"? In searching and
    indexing, such alternatives often need to be treated as more or less
    equivalent, or at least similar, and it's easy to see that this is what
    Google does with content.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Jan 17, 2013
    #15
  16. j

    j Guest

    On 1/16/201On 1/16/2013 9:09 PM, Lewis wrote:> In message
    <kd78h4$5fc$>
    > Jukka K. Korpela <> wrote:
    >> 2013-01-16 22:52, Lewis wrote:

    >

    <snip>
    >
    > I am not saying this is how Google works. It IS how AltaVista worked

    last century.
    >
    >> But, fair enough, URLs may be an exception. Google says:

    >
    >> "Consider using punctuation in your URLs. The URL
    >> http://www.example.com/green-dress.html is much more useful to us than
    >> http://www.example.com/greendress.html. We recommend that you use
    >> hyphens (-) instead of underscores (_) in your URLs."

    >
    > There you go.


    We have a winner!

    Is Google's own recommendation Cargo Cult?

    >
    >>

    http://support.google.com/webmasters/bin/answer.py?hl=en&answer=76329
    >
    >> They don't say why, and they don't say that underscores do something bad
    >> to search engines - even though this would be the right place to say
    >> such things.

    >
    >> So, by all means, use foo-bar rather than foo_bar in URLs. But changing
    >> existing URLs is normally a bad idea.

    >
    > That too.
    >


    As far as non database URLs, I've always locked the URL in at the time
    of creation. So, no problem there.

    That still leaves open the question of what to replace the "-" with in
    product name URLs. For the moment, I am just forbidding their usage.
    Although -dash- is looking tempting.

    Jeff
    j, Jan 17, 2013
    #16
  17. On Thu, 17 Jan 2013 02:09:58 +0000, Lewis wrote:

    > The issue is that in computer languages, _ is not a word boundary
    > character, so the theory for SEO goes that "search-term" sill be parsed
    > properly and "search_term" will not.


    Outside of PCRE, and possibly other forms of regex, is a "word boundary"
    ever defined?

    Technically in regex the word boundary is not the character, it is the
    boundary between a non word character and a word character. From the PCRE
    man page:

    > A word boundary is a position in the subject string where the
    > current character and the previous character do not both match
    > \w or \W (i.e. one matches \w and the other matches \W), or
    > the start or end of the string if the first or last character
    > matches \w, respectively.


    Historically, the issue may be rooted in the fact that underscore has
    been allowed in variable names for a long time, and when people developed
    regex, one of their parsing requirements was computer code, so they
    developed regex in which the underscore character was part of the "word"
    characters rather than the "not word" characters.

    I don't know if "underscore as word character" is a compile time switch
    in PCRE or not, but even if not, I imagine that changing underscore from
    being a word character to a non word character in the regex
    implementation that any particular search engine uses is as simple as
    editing the relevant header file and recompiling the regex library
    object / dll file.

    However, it is probably an even simpler exercise to change the definition
    of a "word" in your regex from "\w+" (or "[[:word:]]+") to "[[:alnum:]]+"
    if you want to include letters and digits but exclude underscores, or
    "[[:alpha:]]" if you just want words comprising of upper and lower case
    letters.

    --
    Denis McMahon,
    Denis McMahon, Jan 17, 2013
    #17
  18. 2013-01-17 12:38, j wrote:

    > Is Google's own recommendation Cargo Cult?


    The cargo cult item here is the hearsay that "-" vs. "_" in URL
    has an impact on search engine ranking. Google has not presented
    any such statement, and the paid advice you referred to did not
    apparently present any facts either.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Jan 17, 2013
    #18
  19. On Thu, 17 Jan 2013 05:38:06 -0500, j wrote:

    > >> But, fair enough, URLs may be an exception. Google says:

    > >
    > >> "Consider using punctuation in your URLs. The URL
    > >> http://www.example.com/green-dress.html is much more useful to us
    > >> than http://www.example.com/greendress.html. We recommend that you
    > >> use hyphens (-) instead of underscores (_) in your URLs."

    > >
    > > There you go.

    >
    > We have a winner!
    >
    > Is Google's own recommendation Cargo Cult?


    Google's recommendation says nothing about SEO. Googles recommendations
    seem to be more geared to being friendly for the crawler, which simply
    grabs pages for the search engine to index, rather than making any
    assertions about how the features discussed may affect page rankings.

    Personally I would be very surprised if _ vs - in the url affected
    pagerank at all!

    --
    Denis McMahon,
    Denis McMahon, Jan 17, 2013
    #19
  20. j <> writes:
    <snip>
    > That still leaves open the question of what to replace the "-" with in
    > product name URLs. For the moment, I am just forbidding their
    > usage. Although -dash- is looking tempting.


    My gut reaction is to leave it alone. If it occurs in the middle of
    product name, you'd get sensible-looking URLs. For a product called
    "foo-bar":

    foo-bar-details.html
    foo-bar-summary.html

    One case for writing it as "dash" might be if the product name uses the
    character literally: for example, a smilie t-shirt with product name
    "t-shirt :)". Here, the two uses of "-" are different. The first I'd
    leave alone, but the second might be rendered as a word:

    t-shirt-colon-dash-close-bracket-details.html

    but

    t-shirt-smiley-details.html

    is probably better overall. And there might considerations that apply
    specifically in your product area. Do your customers (and others) talk
    about the "dash x" and the "dash y" versions of a product, for example?
    If so, there might be an argument for translating it into a word in the
    URL.

    I think the best answer depends on the role that the "-" plays in the
    product name and it's hard to come up with a general answer.

    --
    Ben.
    Ben Bacarisse, Jan 17, 2013
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Bedford
    Replies:
    0
    Views:
    416
    Chris Bedford
    Aug 17, 2003
  2. Kaidi
    Replies:
    5
    Views:
    454
    Andrew Thompson
    Jan 4, 2004
  3. Nathan Sokalski

    Converting Relative URLs into Absolute URLs

    Nathan Sokalski, Aug 11, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    731
    Sriram Srivatsan
    Aug 12, 2008
  4. Adam Monsen

    JDBC URLs ...not really URLs?

    Adam Monsen, Feb 6, 2009, in forum: Java
    Replies:
    11
    Views:
    6,122
    Adam Monsen
    Feb 8, 2009
  5. Steve T.

    dynamic URLS convert to static URLS for search engines

    Steve T., Mar 1, 2004, in forum: ASP .Net Web Services
    Replies:
    7
    Views:
    274
    Steve T.
    Mar 4, 2004
Loading...

Share This Page