关于手机页面的跳转问题

emlog的默认主题提供了一个手机页面,但是在/m的目录下面,访问的时候需要在博客地址后面加上/m,并不是自动跳转的。其实自动跳转实现起来也很容易,国外一个博客提供了跳转函数,我们稍加修改即可使用。

http://detectmobilebrowsers.mobi/

这个网站上有详细说明,不过是英文的,我简单说下自己是怎么做的,首先将函数文件mobile_device_detect.php传到根目录下面,然后再修改index.php。在前面(You need to include the file with the function then call the function before your PHP pages do anything else)加上
require_once('mobile_device_detect.php');
mobile_device_detect(true,false,true,true,true,true,true,'http://laofish.6te.net/blog/m/',false);
?>

第一个地址就是手机将会浏览的地址,第二个是桌面浏览器不跳转,前面的true和false是针对iPhone,ipad之类浏览器可以跳转到不同的地址,我这里只是简单弄一下,原文上可以进行详细的配置。下面就是挑战的文件。

This entry was posted in 技术相关 and tagged , . Bookmark the permalink.

3 Responses to 关于手机页面的跳转问题

  1. Valerie says:

    I'd like to find out more? I'd care to find out some
    additional information.

  2. Traci says:

    Even though the Premier League represents the highest division and is gladly bet
    on, this is not usually the case of the English Football League.

  3. Tyree says:

    You create an account with the bookmaker, then location bets with your funds.

Leave a Reply

Your email address will not be published. Required fields are marked *