Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.4k views
in Q2A Core by
I have a Q2A in portuguese but im having problems with urls. Example:
Here is the question:
Quando o iPad foi lançado oficialmente?
Here is the url:
http://localhost/5/quando-o-ipad-foi-lan%EF%BF%BDado-oficialmente

How can I fix that?

2 Answers

0 votes
by
by
thanks but it still did not resolved my issue! Still same result
Question this:
Relações extraconjugais é um caso sério
Url this:
http://localhost/6/rela%E3%A7%E3%B5es-extraconjugais-%E3%A9-um-caso-s%E3%A9rio
0 votes
by
As far as I can see, that URL is appropriate for the question text. It will appear in most modern web browsers without the % symbols, but rather as the accented Portugese characters. Is the page not being displayed for the URL?
by
Hi there,
The page is displaying correctly without any problems, but in a SEO point of view, it might be a problem... is there any way to change for example â, à, á, ã to a only ? or ê, é, è to e only? change it through .htaccess?
Thanks in advance
by
If you want to, you could change it in the qa_q_request() function in qa-base.php - make substitutions to the $title variable at the start of the function. Having said that, I think it's unlikely that accented characters will have a negative effect on SEO.
by
Cool! It wont have a negative effect on the title, but yes on the url... anyways thanks!
by
I found this code below:

function make_friendly_URL($input) {
    $trans = array("¥" => "Y", "µ" => "u", "À" => "A", "Á" => "A", "Â" => "A", "Ã" => "A", "Ä" => "A", "Å" => "A", "Æ" => "A", "Ç" => "C", "È" => "E", "É" => "E", "Ê" => "E", "Ë" => "E", "Ì" => "I", "Í" => "I", "Î" => "I", "Ï" => "I", "Ð" => "D", "Ñ" => "N", "Ò" => "O", "Ó" => "O", "Ô" => "O", "Õ" => "O", "Ö" => "O", "Ø" => "O", "Ù" => "U", "Ú" => "U", "Û" => "U", "Ü" => "U", "Ý" => "Y", "ß" => "s", "à" => "a", "á" => "a", "â" => "a", "ã" => "a", "ä" => "a", "å" => "a", "æ" => "a", "ç" => "c", "è" => "e", "é" => "e", "ê" => "e", "ë" => "e", "ì" => "i", "í" => "i", "î" => "i", "ï" => "i", "ð" => "o", "ñ" => "n", "ò" => "o", "ó" => "o", "ô" => "o", "õ" => "o", "ö" => "o", "ø" => "o", "ù" => "u", "ú" => "u", "û" => "u", "ü" => "u", "ý" => "y", "ÿ" => "y", "I'll" => "I+will", "'" => "+", "(" => "", ")" => "", "!" => "", " " => "+", " - " => "+/+");
    $input = strtr($input, $trans);
    return $input;
}

maybe the solution?
by
That looks like it will work - you could just add that function to qa-base.php then insert this line at the start of qa_q_request():

$title=make_friendly_URL($title);

But: make sure you are editing qa-base.php with UTF-8 text encoding in your text editor, otherwise the character substitutions will be stored wrongly in the PHP file.
by
That is it!!! it fixed!!! Thanks for your support!
...