What char should be used to replace illegal characters in a url
I've noticed that different systems use different characters as surrogate characters for illegal in URLs.
Is there a reason to use one or the other, or should I just pick the one that looks best to me.
The options I've seen so far include: - _ + and just remove all illegal characters.
0
a source to share
4 answers
By leaving characters alone you can make really weird strings. Indeed, strange lines don't help SEO.
The "nicest" solution is to transliterate your non-ascii characters to their ascii equivalent. This can be done using Iconv (if you are on unix platform)
You may also want to take a look at: How to handle diacritics (accents) when rewriting "good URLs"
But this is a PHP specific question
Hope it helps
+1
a source to share