PHP mobile redirect Endless loop
Disable the plugin at all and in your function.php add add_action(‘init’, ‘my_mobile_redirect’); function get_first_url_subdir() { return str_replace( str_replace( array(‘http://’, ‘https://’), ”, get_site_url() ), ”, $_SERVER[‘SERVER_NAME’] . $_SERVER[‘REQUEST_URI’]); } function redirect_mobile_with_cookie() { $cookiename=”redirect_mobile_is_a_mobile_device”; if ( isset($_COOKIE[$cookiename]) && ($_COOKIE[$cookiename] == ‘yes’) && strpos(get_first_url_subdir(), ‘/mobile’) !== 0) return true; return false; } function my_mobile_redirect(){ if ( redirect_mobile_with_cookie() ) … Read more