<?php
$language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,5);
if($language == "zh-cn") header("Location: /gbk/chinese.html");
else header("Location: /utf8/english.html");
?>
通过以上代码就可以轻松实现,根据语言不同,跳转到相应的子域名,或者屏蔽中文浏览者Sexy Shoes.
$language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,5);
if($language == "zh-cn") header("Location: /gbk/chinese.html");
else header("Location: /utf8/english.html");
?>
通过以上代码就可以轻松实现,根据语言不同,跳转到相应的子域名,或者屏蔽中文浏览者Sexy Shoes.