Disable redirection script

We have a redirect script on our site that detects mobile devices and redirects users to a subdomain which goes to the mobile site folder. But now we need a mechanism that gives the visitor a button on the page that then reloads the page and bypasses this check. The goal is if a smartphone user wants to see the full site, we need to give them a button to push to do so. So, the question is: is it possible to disable this script when user clicks on that button?

Answers


I beleive cookies are a more better solution since they will not go away when the page is changed.

Just make a cookie when the user clicks the button and send him to the mainsite.

How to make the cookie:_

setcookie("fullsite", "SomeRandomThing", time()+60*60*24*30); // It will expire after a month

If the cookie is not set, then make it redirect.

if (!isset($_COOKIE['fullsite'])
{
  // redirect
}

Similarily make a button for the user to switch back and make that button delete the cookie.


yes you can. load script according to the button press.

if((!isset($_POST['button']) && mobiledevice==true))
{
         //put your redirection script here
}

use something like above


What I have done in the past is have a button on all the mobile specific pages that sets a cookie and then redirects the user back to the non mobile page, that cookie is read and if set adds a "back to mobile" banner and skips the mobile redirection code.

Also did a one time use version of this that does not show the "back to mobile" banner and automatically clears the cookie so the next page the suer visits they are back to mobile


Need Your Help

Required Fields to not required

c# wpf xaml

I have 3 required fields. If one of the fields has data inputted into it, then the other two should be not required. The case is the same for all three. If any one field has data then none of them ...

How do free and malloc work in C?

c memory free malloc

I'm trying to figure out what would happened if I try to free a pointer "from the middle"