Jump to content

mysite.com/en to mysite.com how to change?


adamus007p

Recommended Posts

Hi,

 

how ot change mysite.com/en/ to mysite.com only for main website

 

for other category for en and for other languages I want to leave by default

 

mysite.com/de/

mysite.com/fr/

 

 

mysite.com/en/category-xxxx/xxxx

mysite.com/en/category-xxxx/22222

 

etc.

 

only first website I would like to have without en which is my default language

Link to comment
Share on other sites

  • 3 weeks later...

For that, you must "hack" the Link::getLangLink function and the .htaccess

 

For the first:

 

/classes/Link.php (it's recommended override the class)


       protected function getLangLink($id_lang = NULL)
       {
               if (!$this->allow OR Language::countActiveLanguages() <= 1)
                       return '';

               global $cookie;
               if (!$id_lang)
                       $id_lang = (int)$cookie->id_lang;

// NEW CODE
               if ($id_lang == 1)  // if it's english
                       return '';
// END NEW CODE


               return Language::getIsoById((int)$id_lang).'/';
       }

 

 

On .htaccess change all lines with /en/ for / (Or hack the .htaccess generator) :P

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...