Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
561 views
in Q2A Core by
The URL structure for foreign characters (Spanish, Portuguese etc.)  is poor if you choose the first option for URL structures, which is really the only option for SEO purposes.

What happens is that the URL structure keeps foreign characters, like ç or ã in the URL instead of replacing these with a regular c or a. This will cause problems because the canonocial URL will have % URL encoding characters instead of regular letters. Not good for SEO or usability.

This is relatively simple to fix with a preg_replace. But, where in the code is the URL created so that one can simply replace all foreign characters with their regular counterpart?
by
BTW, I found the information below on Stackoverflow, where could one implement the code found on http://neo22s.com/slug/, so one doesn't have accented characters in the URL?

"You probably shouldn't include accented etc. characters in your post slug since, technically, they should be percent encoded (per URL encoding rules) so you'll have ugly looking URLs.

So, if I were you, after lowercasing, I'd convert any 'special' characters to their equivalent (e.g. é -> e) and replace non [a-z] characters with '-', limiting to runs of a single '-' as you've done. There's an implementation of converting special characters here: http://neo22s.com/slug/
"
http://stackoverflow.com/questions/2668854/sanitizing-strings-to-make-them-url-and-filename-safe

1 Answer

+1 vote
by
If anyone else experiences this, I finally figured it out.

There is a setting in Admin->Viewing->Remove Accents from Question URL's which seems to work. Still need to do more testing on it.
by
Thanks, it works for me
...