views:

1067

answers:

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

+1  A: 

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

dove
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
A: 

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?

Ken Pespisa
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
+2  A: 

Would ~ (tilde) work?

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

Colonel Sponsz
Sweet, that sorts out the whole problem. Cheers
Zac