爱是王道 发表于 2018-11-29 08:56:18

apache实现手机访问www网站自动跳转到WAP站点

  apache实现手机访问www网站自动跳转到WAP站点
  vi /usr/local/apache2/conf/httpd.conf   

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Via}i\"" combinedwap   
CustomLog "logs/access_log" combinedwap   

RewriteLogLevel 9
RewriteEngine On   
RewriteLog "/usr/local/apache2/logs/rewrite_wap.log"

   
    Options FollowSymLinks   
    AllowOverride None   
    Order deny,allow   
    Deny from all   
       RewriteEngine On   
       RewriteCond %{HTTP:Via} ^.*WAP.*   
       RewriteRule   ^(.+)http://hehe.abc.com   

通过运营商提供的Via信息实现跳转,但是对智能机效果不是很好,因为智能机很多是支持www浏览器的



页: [1]
查看完整版本: apache实现手机访问www网站自动跳转到WAP站点