Hello to all.

I have such a link - www.example.com/ . I want, when someone came to the site, the link was automatically so - www.example.com/en

While .htaccess is:

 RewriteEngine on RewriteCond $1 !^(index\.php|images|uploads|js|css|help|robots\.txt|favicon\.ico|doc) RewriteRule ^(.*)$ /index.php/$1 [L] 

(CodeIgniter, I want a multilingual site).

    3 answers 3

    (CodeIgniter, I want a multilingual site) Then you need to put the $ lang variable on the main page of www.example.com/index.php in the user variable to check and enable the folder with the language ie:

     if(isset($lang)){ include("/".$lang."/index.php") 

    or just make a lang folder there create ru.inc en.inc files, etc. and in them:

     $lang=array( "0" => "Введенные пароли не совпадают!", "1" => "Пароль должен состоять из лат. букв или/и цифр!" ) 

    then the output of this text will be:

     echo"Ошибка: ".$lang[1]; 

      The first value from which address, the second value to where.

       Redirect www.example.com/ www.example.com/en/ Redirect www.example.com/index.php www.example.com/en/index.php 

        The same can be done with the usual function header()