Support » Plugin: Simple Mobile URL Redirect » Directory exclusion

  • Resolved rembert


    I’ve installed this plugin with success and it works well. I have built a mobile site on a wordpress environment with MobileChief Mobile Site Builder. This plugin builds the mobile site on a sub folder of the main site.

    At first I suspected the MobileChief plugin to be in error as any link I clicked returned me to the mobile homepage. But with some debugging I discovered it was the Simple Mobile URL Redirect plugin which was causing problems as the plugin will redirect each and every URL which is different from the forwarding URL. I’ve considered to install the JumpMobi plugin instead but their site is down for maintenance. So I decided to patch your plugin to support excluding a directory from forwarding. This is a rather easy patch. To exclude the directory /mobile-sites/ from forwarding

    To patch, edit the file wp-content/plugins/simple-mobile-url-redirect/mobile-redirect.php and find this line:

    $cur_url = esc_url("http://". $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] );

    Then add following lines to it:

    $exclude = '/mobile-sites/';
    $cur_urlparsed = parse_url($cur_url);
    if (strpos($cur_urlpath,$exclude) === 0) return;

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Directory exclusion’ is closed to new replies.