Support » Plugin: Mobile Domain » [Plugin: Mobile Domain] Can you whitelist URLs?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Yusuf


    Sorry for a long reply,
    yes there is, but user have to click “Desktop Version” in the bottom of mobile site, then cookie will stop redirecting wordpress to mobile version.

    How to do it? Link to desktop version on my mobile domain doesn’t allow user to go to Desktop version. Any special url query parameters or something?

    We ended up using this plugin. and basically edited the mobileesp_wp.php file to include some if statements toward the top. You don’t include the domain in the URI string.

    We still needed the ability to have the user bypass the mobile domain completely so we didn’t highjack that. Instead, for the pages we wanted to whitelist, we cookied them for a short amount of time.

    Example of the code we injected after the define statement…

    if($_SERVER['REQUEST_URI'] == '/page-uri-after-domain-1/'){
    	//print page & exit
    	setcookie("mobileesp_wp_full_site", 1, time()+5, "/", $domain);
    	$_COOKIE['mobileesp_wp_full_site'] = 1;
    if($_SERVER['REQUEST_URI'] == '/page-uri-after-domain-2/'){
    	//print page & exit
    	setcookie("mobileesp_wp_full_site", 1, time()+5, "/", $domain);
    	$_COOKIE['mobileesp_wp_full_site'] = 1;

    I ended up using Tera-WURFL. I was planning it but was to lazy to get to know it. It came out it was so easy… You can install it on your host or use it installed on

    I made very universal version of my configuration, so I can pass it to someone (client’s webmaster) and give him no more than a minute of work to set redirection for me.

    I add 1 line to .htaccess file:

    DirectoryIndex handleRequest.php index.html index.shtml index.php index.htm default.html Default.htm default.html Default.html default.shtml Default.shtml page1.html index.cgi index.php3 index.phtml home.htm home.html home.shtml index.wml

    Attach my handleRequest.php file:

    // Include TeraWurflRemoteClient.php
    require_once ('TeraWurflRemoteClient.php');
    // Instantiate a new TeraWurflRemoteClient object
    $wurflObj = new TeraWurflRemoteClient('');
    // Define which capabilities you want to test for. Full list:
    $capabilities = array("product_info");
    // Define the response format (XML or JSON)
    $data_format = TeraWurflRemoteClient::$FORMAT_JSON;
    // Call the remote service (the first parameter is the User Agent - leave it as null to let TeraWurflRemoteClient find the user agent from the server global variable)
    $wurflObj->getCapabilitiesFromAgent(null, $capabilities, $data_format);
    // Use the results to serve the appropriate interface
    if ($wurflObj->getDeviceCapability("is_tablet") || !$wurflObj->getDeviceCapability("is_wireless_device") || $_GET["ver"]=="desktop") {
    	include("index.php"); //default index file
    } else {
    	header('Location:'); //where to go

    And attach required TeraWurflRemoteClient.php file. Just add “?ver=desktop” when linking back to desktop website and you are set 🙂

    I tried MobileESP but it didn’t recognize my Android phone with Dolphin HD browser so I passed on it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Mobile Domain] Can you whitelist URLs?’ is closed to new replies.