tearawayTea
Member
Posted 8 months ago #
I'm using two languages for my site "en" and "ru". My Gengo settings are
Gengo should append language codes to permalinks automatically - TRUE
Allow visitors to read this site in a combination of languages - FALSE
Let Gengo choose the best languages to display - TRUE
Set blog default language: Russian
I have been writing RU posts into my blog without Gengo installed during last year. So there are a lot of links in Google without "/en/" or "/ru/" postifixes in urls.
So I found a problem, if user hasn't set gengo cookies in browser and opens old links from Google for a first time he gets Redirect Loop. But if user has opened blog's index page and try to open url without "/en/" or "/ru/" at the end all works fine.
tearawayTea
Member
Posted 7 months ago #
I have found another condition for this issue. If user opens old link like this for a first time
http://tearaway-tea.com/blog/2009/03/flex-guys-wanted/
blog automatically redirects it to
http://tearaway-tea.com/blog/2009/03/flex-guys-wanted/ru/
thats OK.
But it don't work for links with russian characters like this
http://tearaway-tea.com/blog/2009/02/контексты-функций-в-action-script/
that link causes browsers Redirect Loop. So maybe the problem is in character's encoding.
tearawayTea
Member
Posted 7 months ago #
Maybe I can add a rewrite rule into .htaccess which will add "/ru/" postfix to url without and languages defined. It will be suitable for me because all my previous articles was written in russian.
tearawayTea
Member
Posted 7 months ago #
I have fixed a bug by adding the code into index.php
$url = $_SERVER["REQUEST_URI"];
if (!(strpos($url, "/ru/") || strpos($url, "/en/")))
{
header("Location:http://" . $_SERVER["HTTP_HOST"] . $url . "ru/");
exit();
}