['HTTP_REFERER'] 本来就是不可靠的。建议使用apache的RewriteRule。

解决方案 »

  1.   

    你这个应该是二级域名使用吧,使用url重写会方便一些
      

  2.   

    apache配个mod_rewrite 然后写个.htaccess文件
      

  3.   

    apache Virtual hosts 没测试过,大意如此 http://httpd.apache.org/docs/2.2/vhosts/name-based.html===========
    NameVirtualHost *:80<VirtualHost *:80>ServerName www.xinxi.cc
    ServerAlias xinxi.cc www.xinxi.cc
    DocumentRoot /www/domain</VirtualHost><VirtualHost *:80>ServerName 123.xinxi.cc
    DocumentRoot /www/otherdomain</VirtualHost>
      

  4.   

    $_SERVER['HTTP_HOST'] 而非 $_SERVER['HTTP_REFERER']
      

  5.   

    $_SERVER['HTTP_HOST'] 而非 $_SERVER['HTTP_REFERER']同上,楼主搞错了概念了!!