0
我使用多种语言。但是,我有一个问题。这是我的代码不工作。 默认语言始终有效。htaccess多语言不工作
例如:?
www.mysite.com/tr/hakkimizda
www.mysite.com/en/about-us
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{QUERY_STRING} ^dil=([a-z]{2})(?:&|$) [NC]
RewriteRule !^[a-z]{2}/ /%1/%{REQUEST_URI}? [L,NC,R=301]
# default
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{QUERY_STRING} !^dil=.+(&|$) [NC]
RewriteRule !^tr/ /tr/%{REQUEST_URI} [L,NC,R=301]
**language.php**
$dil=$_GET["dil"];
if(file_exists("dil/".$dil.".php")){
$_SESSION["dil"]=$dil;
header("Location:/");
}else{
header("Location:tr");
}
链接类型
language.php稀= TR(位置的index.php)
language.php?稀= EN(位置的index.php)
I W蚂蚁是
www.mysite.com/tr/hakkimizda
www.mysite.com/en/about-us
感谢。但是,这段代码不起作用。错误代码:ERR_TOO_MANY_REDIRECTS –