Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/196.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 移动重定向域级别,保留页面url_Android_Mobile_Jquery Mobile_Url Rewriting - Fatal编程技术网

Android 移动重定向域级别,保留页面url

Android 移动重定向域级别,保留页面url,android,mobile,jquery-mobile,url-rewriting,Android,Mobile,Jquery Mobile,Url Rewriting,我发现了移动检测和重定向脚本,但在整个站点级别上,例如,如果您使用移动/智能手机/平板电脑访问内部页面,例如www.site.com/this_page.php,您将被重定向到代理子域站点,比如m.site.com 这不适合我所需要的,我正在寻找一些在浏览器/设备检测方面很好的东西,然后将您重定向到完全相同的页面,但在子域上,使用上面的示例,它应该是:m.site.com/This_page.php 有这样的剧本吗 最好的祝愿如果我理解正确,您应该能够在网站的任何位置使用设备检测脚本php或其他

我发现了移动检测和重定向脚本,但在整个站点级别上,例如,如果您使用移动/智能手机/平板电脑访问内部页面,例如www.site.com/this_page.php,您将被重定向到代理子域站点,比如m.site.com

这不适合我所需要的,我正在寻找一些在浏览器/设备检测方面很好的东西,然后将您重定向到完全相同的页面,但在子域上,使用上面的示例,它应该是:m.site.com/This_page.php

有这样的剧本吗


最好的祝愿

如果我理解正确,您应该能够在网站的任何位置使用设备检测脚本php或其他。例如,将您的示例用于框架:

<?php
include('51Degrees/51Degrees.mobi.php');

$IsMobile = $_51d["IsMobile"] == "True";
    if ($IsMobile)
        redirect(m.site.com);
    else
        redirect(www.site.com);
?>
这可以嵌入到索引的HTML中,也可以放在/This_page.php中:

<?php
include('51Degrees/51Degrees.mobi.php');

$IsMobile = $_51d["IsMobile"] == "True";
    if ($IsMobile)
        redirect(m.site.com/this_page.php);
    else
        redirect(www.site.com/this_page.php);
?>
这取决于你把代码放在哪里