繁体   English   中英

不带htaccess的joomla移动重定向

[英]mobile redirect with joomla without htaccess

我有一个joomla网站,

  1. 我正在为此做一个移动网站。
  2. 我希望移动网站具有“完整网站”选项。

When I do this, the redirect kicks in again. So the mobile user clicks full site, and the full sure is loaded, which has the mobile redirect script, then they get sent back to the mobile site When I do this, the redirect kicks in again. So the mobile user clicks full site, and the full sure is loaded, which has the mobile redirect script, then they get sent back to the mobile site

你们能建议我该怎么做吗?
也,

  • 我的手机网站是手工制作的
  • 这不是joomla模板

所以我需要它重定向到子文件夹,而不是新的joomla模板。 而且我不想使用移动joomla。 我也没有htaccess的经验,谢谢

您可以通过js文件来实现。

请访问此网站,然后选择正确的方法: http : //detectmobilebrowsers.com/

您有很多选择,只有您需要/喜欢的一个。

您可以使用PHP来完成。 尝试这样的事情:

<?php

$iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
$palmpre = strpos($_SERVER['HTTP_USER_AGENT'],"webOS");
$berry = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
$ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");

if ($iphone || $android || $palmpre || $ipod || $berry == true) { 
    header('Location: http://mobile.site.com/');
}

?>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM