简体   繁体   English

手机网站-如何切换到桌面版

[英]Mobile website - how to switch to desktop version

I have a WordPress website ( abetterworldbydesign.com ) which has user-agent detection to redirect mobile websites to a subdirectory. 我有一个WordPress网站( abetterworldbydesign.com ),该网站具有用户代理检测功能,可将移动网站重定向到子目录。 It is using the plugin: WPtap Mobile Detector 它正在使用插件: WPtap Mobile Detector

I want to include a toggle link to switch between the mobile and desktop version. 我想包含一个切换链接,以在移动版本和桌面版本之间进行切换。 How can I make the site remember that a mobile user has switched to the desktop version and avoid redirecting that user to the mobile version again? 如何使网站记住移动用户已切换到桌面版本,并避免将该用户再次重定向到移动版本?

Checking the HTTP_REFERRER is the easiest method - no cookies & just one check. 检查HTTP_REFERRER是最简单的方法-不使用Cookie,只需检查一次即可。 If the referrer is on your domain - then don't redirect. 如果引荐来源网址位于您的域中-请不要重定向。

会话可能是最简单的会话,或者仍然可以检测到移动设备,但是URL带有?mobile=false附加,可以防止用户被重定向,但允许他们轻松地返回移动网站。

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

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