0

I have a multistore language, lets say I have example.com with /en (english) and /fr (french). The default store is the french one.

So when somebody enters example.com he goes to the french store but the url remains example.com, and I need that only example.com/fr and example.com/en are available. So if somebody writes down example.com goes to example.com/fr automatically.

now I have that:
if you enter example.com    you go to example.com    in french.
if you enter example.com/fr you go to example.com/fr in french.
if you enter example.com/en you go to example.com/en in english.

I need that:
if you enter example.com    you go to example.com/fr in french
if you enter example.com/fr you go to example.com/fr in french.
if you enter example.com/en you go to example.com/en in english.

I have been searching, and I only see how to remove the language from the default store. But I need to add it always so nobody can go to the url without language.

I think it is not a good idea, but it is what I have to do.

PD: I have amasty geoip redirect installed

0

I solved it editing the index.php. The fr store id is 2, so the working code is:

$storeId = Mage::app()->getStore()->getStoreId();
if ($storeId == 2) {
    $url = $_SERVER['REQUEST_URI'];
    if ($url=='/') {
        $url = 'fr';
        header("Location: $url");
        return;
    }
}

Personally, I don't like the solution, but it seems to work and it does not break the geoip redirections.

  • Are you using nginx for your server? You can achieve via nginx – Ricky Odin Matthews Nov 6 '18 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.