When a mobile user views my site they are redirected to a mobile version. I have a "view full" option to allow them to view the actual site instead. Problem is when they do they will get redirected back. Is there away to bypass the redirect or only redirect the first time?
As far as I know, almost all mobile browsers have basic cookie support. PHP setcookie (documentation here) will allow you to do something like this:
setcookie('default_view', MOBILE);
Where MOBILE is defined ahead of time. You're also free to use a string here.
The upside is you won't have to worry about the query string once this cookie is set. SLaks' solution will work, but you would have to pay attention to append redirect=false to every URL that has a redirect-checker.
You can add a querysting such as ?redirect=false.
Before redirecting, check for this querystring.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With