如果用户使用手机,我想重定向页面
https://example.com
https://example.com/mobile/。
请建议我php
或.htaccess
代码
http://mobiledetect.net/
使用这个你可以很容易地检查它是否是移动的。
include 'Mobile_Detect.php';
$detect = new Mobile_Detect();
// Check for any mobile device.
if ($detect->isMobile())
header('Location: https://example.com/mobile');
else
// other content for desktop