手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

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

[日期:2011-12-23] 来源:Linux社区  作者:logo32 [字体:大 中 小]

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

  1. vi /usr/local/apache2/conf/httpd.conf   
  2.   
  3. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Via}i\"" combinedwap   
  4. CustomLog "logs/access_log" combinedwap   
  5.   
  6. RewriteLogLevel 9  
  7. RewriteEngine On   
  8. RewriteLog "/usr/local/apache2/logs/rewrite_wap.log"  
  9.   
  10. <Directory />   
  11.     Options FollowSymLinks   
  12.     AllowOverride None   
  13.     Order deny,allow   
  14.     Deny from all   
  15.        RewriteEngine On   
  16.        RewriteCond %{HTTP:Via} ^.*WAP.*   
  17.        RewriteRule   ^(.+)  http://m.abc.com   
  18. </Directory>  

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

linux
相关资讯       Apache 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款