la regla que escribo es la siguiente
Código:
Y la implementacion es la siguienteRewriteRule ^(de|es|fr|it|tr|sv|pl|ru|nl|gr|da|no)$ $1/ [R=301] [NC,L] RewriteRule ^(de|es|fr|it|tr|sv|pl|ru|nl|gr|da|no)/$ index_org.php [NC,L] RewriteRule ^(de|es|fr|it|tr|sv|pl|ru|nl|gr|da|no)/index_org.php$ index_org.php?%{QUERY_STRING} [NC,L] RewriteRule ^(de|es|fr|it|tr|sv|pl|ru|nl|gr|da|no)/(.*\.php)$ $2?%{QUERY_STRING} [NC,L]
Código PHP:
if(strpos($_SERVER['REQUEST_URI'], "/de/")!=0){
$language = 'de';}
else
if(strpos($_SERVER['REQUEST_URI'], "/es/")!=0)
{$language = 'es';
}
else
if(strpos($_SERVER['REQUEST_URI'], "/fr/")!=0)
{$language = 'fr';}
else
if(strpos($_SERVER['REQUEST_URI'], "/it/")!=0)
{$language = 'it';}
else
if(strpos($_SERVER['REQUEST_URI'], "/tr/")!=0)
{$language = 'tr';}
else
if(strpos($_SERVER['REQUEST_URI'], "/sv/")!=0)
{$language = 'sv';}
else
if(strpos($_SERVER['REQUEST_URI'], "/pl/")!=0)
{$language = 'pl';}
else
if(strpos($_SERVER['REQUEST_URI'], "/ru/")!=0)
{$language = 'ru';}
else
if(strpos($_SERVER['REQUEST_URI'], "/nl/")!=0)
{$language = 'nl';}
else
if(strpos($_SERVER['REQUEST_URI'], "/gr/")!=0)
{$language = 'gr';}
else
if(strpos($_SERVER['REQUEST_URI'], "/da/")!=0)
{$language = 'da';}
else
if(strpos($_SERVER['REQUEST_URI'], "/no/")!=0)
{$language = 'no';}
else
{
$language = 'en';
}