barney0o0 Posted November 5, 2009 Share Posted November 5, 2009 Hi Chaps Im trying to figure out the best method to have a multi language website that will function with seo friendly links. The code that ive used many times before..... $_SESSION['lang'] = $lang = (isset($_GET['lang']) ? mysql_real_escape_string(trim($_GET['lang'])) : (isset($_SESSION['lang']) ? $_SESSION['lang'] : 'en')); if (!function_exists("GetSQLValueString")) which i like as it refreshes the page that the viewer is on and pulls down info form the db with the correct extension i.e. about_en, about_it, about_de etc etc The problem is when the user changes the language using with the follwing... if ($_SERVER['QUERY_STRING']) { echo "<a href=\"?{$_SERVER['QUERY_STRING']}&lang=en\">EN</a>"; } else { echo "<a href=\"?lang=en\">EN</a>"; } ?></li> <li><?php if ($_SERVER['QUERY_STRING']) { echo "<a href=\"?{$_SERVER['QUERY_STRING']}&lang=it\">IT</a>"; } else { echo "<a href=\"?lang=it\">IT</a>"; } ?></li> <li><?php if ($_SERVER['QUERY_STRING']) { echo "<a href=\"?{$_SERVER['QUERY_STRING']}&lang=fr\">FR</a>"; } else { echo "<a href=\"?lang=fr\">FR</a>"; the page refreshes but with '?lang=it' at the end of the address, therefore im 'presuming' the mod_rewrite will fail... any ideas of what would be the best solution.. many thanks in advance Link to comment https://forums.phpfreaks.com/topic/180382-multi-language-seo-links/ Share on other sites More sharing options...
barney0o0 Posted November 9, 2009 Author Share Posted November 9, 2009 Is there anyone that can help me with this......i think the main that is some form of script that will refresh the present page upon language chnage without adding the ?lang=blah.... Link to comment https://forums.phpfreaks.com/topic/180382-multi-language-seo-links/#findComment-953998 Share on other sites More sharing options...
barney0o0 Posted November 14, 2009 Author Share Posted November 14, 2009 sorry, i dont want to bump....but i dont want to start a new topic either!... Is there anyone that can help with this solution?....my knowlegde is too limited Link to comment https://forums.phpfreaks.com/topic/180382-multi-language-seo-links/#findComment-957362 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.