3

We're currently replacing all special characters and spaces in our URLs with hypens (-). From an SEO and readability point-of-view this works fine. However, in some cases, we are feeding parts of the URL into a search after stripping the hyphens out. The problem occurs when the search term should have hyphens as it returns no results when they get stripped. We could modify the search algorithm we're using but this will slow it down (especially bad as we're using it with an AJAX-ed search box and this needs to be fast).

The best option to deal with this, as far as we can tell is to replace pre-existing hyphens with pipes (|). I have a feeling that this will have a negative impact on SEO for those terms as the pipe character will be treated as a part of the word and not as a separator. As far as I can tell, the only characters that are considered to be separators are hyphens and forward slashes (/).

So my questions are:

  1. Are there alternative characters we can use to represent hyphens?
  2. If we can't use any other characters, how much impact will using a pipe character have on a search engine?

Cheers, Zac

3 Answers 3

3

Would ~ (tilde) work?

Edit: Google now treats underscores and dashes as word separators so you can use dashes as dashes and underscores as spaces.

2
  • 1
    Sweet, that sorts out the whole problem. Cheers
    – Zac Seth
    Commented Nov 7, 2008 at 1:25
  • UPDATE: At the Google IO conf. in SFA in 2010, Google engineers said that only dashes (NOT underscores) are treated as spaces
    – Houen
    Commented Aug 17, 2011 at 14:49
0

Why not use Url Encoding? Most frameworks have built in utilities to do this.

1
  • Two reasons: 1: We use ASP.Net MVC routing over IIS 6 with Isapi_Rewrite. Using URLEncoded characters still appear as spaces to IIS and this causes bad requests. 2: We want the URLs to be human readable and remember-able. We don't think %20 or similar matches these criteria. Cheers for replying
    – Zac Seth
    Commented Nov 6, 2008 at 22:36
0

I was going to say the same thing about URL encoding, but if you're trying to get rid of the special characters, I suppose you don't want URLs with percent signs, right?

What about altering the algorithm that "feeds parts of the URL into a search"? Couldn't you add some logic to not replace hyphens within the search query part of the URL?

1
  • Yeah, you're right. We don't want to display percent signs in the URL. We are replacing hyphens with spaces when we feed it into the search but in some cases we want to keep the hyphens. Hence we want to use pipes to represent hyphens.
    – Zac Seth
    Commented Nov 6, 2008 at 22:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.