ryan3477 Posted March 10, 2010 Share Posted March 10, 2010 Shortly, i am using OpenRealty but it doesnt SEO friendly urls very well with special characters (turkish in my case) The original lines go on like this : $this->page = preg_replace_callback('/{page_link_(.*?)}/is', create_function('$matches', 'global $config; require_once($config[\'basepath\'].\'/include/page_display.inc.php\'); $title = page_display::get_page_title($matches[1]); $title = strtolower(str_replace(" ", $config[\'seo_url_seperator\'], $title)); return $config[\'baseurl\'].\'/page-\'.urlencode($title).\'-\'.$matches[1].\'.html\';'), $this->page); I have tried adding below arrays and using str_replace: $trchar = array("s", "ü", "i", "ö", "S", "G", "g", "ç", "I", "Ç", "Ö", "Ü"); $enchar = array("s", "u", "i", "o", "S", "G", "g", "c", "I", "C", "O","U"); $this->page = preg_replace_callback('/{page_link_(.*?)}/is', create_function('$matches', 'global $config; require_once($config[\'basepath\'].\'/include/page_display.inc.php\'); $title = page_display::get_page_title($matches[1]); $title = strtolower(str_replace($trkar, $enkar, $title)); return $config[\'baseurl\'].\'/page-\'.urlencode($title).\'-\'.$matches[1].\'.html\';'), $this->page); but it doesnt seem to work.. any help would be appreciated thanks in advance Link to comment https://forums.phpfreaks.com/topic/194767-help-with-special-characters-in-the-url/ Share on other sites More sharing options...
gwolgamott Posted March 10, 2010 Share Posted March 10, 2010 Have you tried using urlencode()? I asking about using a & in the url a while ago and was told to use that, worked good for me to fix that issue. Not sure if that will help with your issue, but could try it. http://us2.php.net/manual/en/function.urlencode.php Link to comment https://forums.phpfreaks.com/topic/194767-help-with-special-characters-in-the-url/#findComment-1024226 Share on other sites More sharing options...
ryan3477 Posted March 10, 2010 Author Share Posted March 10, 2010 it already does encode however its just useful for not getting 404's, otherwise it does not help the links being readable or seo friendly..."Te%3Fxt%d" etc etc.. does this look friendly to you ? i gotta convert/replace turkish characters to with the ones from the english alphabet.. it seems like a easy task for someone with a reasonable php knowledge, noone else ? Link to comment https://forums.phpfreaks.com/topic/194767-help-with-special-characters-in-the-url/#findComment-1024263 Share on other sites More sharing options...
jl5501 Posted March 10, 2010 Share Posted March 10, 2010 I would suggest that you need an addon for OR, or an extension to the SEO code, to handle the conversion of the non english characters Link to comment https://forums.phpfreaks.com/topic/194767-help-with-special-characters-in-the-url/#findComment-1024280 Share on other sites More sharing options...
gwolgamott Posted March 10, 2010 Share Posted March 10, 2010 misread what you wanted apparently. Anyways doesn't open reality use a special htaccess setting that will do this EDIT: not for the replace of characters, but can do that in another manner. For that is not just simply replacing the characters. Link to comment https://forums.phpfreaks.com/topic/194767-help-with-special-characters-in-the-url/#findComment-1024289 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.