21,887
社区成员
发帖
与我相关
我的任务
分享
#版本不一样 上传服务器上必须修改Host为%{HTTP:Host}
RewriteCond Host: ankang\.0917cc\.com
RewriteRule ^(.*)$ /zhuanti/ankang/$1 [I]
RewriteCond Host: baoji\.0917cc\.com
RewriteRule ^(.*)$ /zhuanti/baoji/$1 [I]
RewriteCond Host: hanzhong\.0917cc\.com
RewriteRule ^(.*)$ /zhuanti/hanzhong/$1 [I]
RewriteCond Host: shangluo\.0917cc\.com
RewriteRule ^(.*)$ /zhuanti/shangluo/$1 [I]
RewriteCond Host: tongchuan\.0917cc\.com
RewriteRule ^(.*)$ /zhuanti/tongchuan/$1 [I]
RewriteCond Host: xianyang\.0917cc\.com
RewriteRule ^(.*)$ /zhuanti/xianyang/$1 [I]
RewriteCond Host: yanan\.0917cc\.com
RewriteRule ^(.*)$ /zhuanti/yanan/$1 [I]
RewriteCond Host: yulin\.0917cc\.com
RewriteRule ^(.*)$ /zhuanti/yulin/$1 [I]
RewriteCond %{HTTP:Host} ^0917cc.com$
RewriteRule (.*) http://www.0917cc.com$1 [NC,R=301]
<?php
$Url = $_SERVER['HTTP_HOST'];
if( $Url === '默认的主域名' ){
// 跳入主域名下
}else{
$Pre = strtok( $Url );
if( $Pre !==false && in_array( $Pre , $allowUrlArr ) ){
f( $Pre ); // 这里就开开始显示不同地区的内容
}
}
?>