I've got a WordPress website (abetterworldbydesign.com) that has user-agent recognition to redirect mobile websites to some subdirectory. It's while using wordpress plugin: WPtap Mobile Detector

I wish to incorporate a toggle connect to switch between your mobile and desktop version. How do i result in the site keep in mind that a mobile user has switched towards the desktop version and steer clear of redirecting that user towards the mobile version again?

A session will most likely function as the simplest, or still identify mobile, but possess a ?mobile=false attached the URL that prevents the consumer from being rerouted, but enables these to easily return to the mobile site.

Checking the HTTP_REFERRER may be the simplest method - no snacks &lifier only one check. When the referrer is in your domain - then don't redirect.