Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter adopted3

    (@adopted3)

    Just tested on an iPhone… same problem ??

    Plugin Author Joe Rhoney

    (@joerhoney)

    With AddFunc Mobile Detect activated, if you are at your mobile website and then you click a link on your mobile site that takes you to your main website, that is detected and a cookie is stored in your browser which now says “don’t redirect that mobile website anymore.” I designed it that way because if the visitor specifically navigated to the desktop site, then we don’t want to just keep pushing him/her back over to the mobile site. This cookie stays cached until you “restart” your browser. What that entails is different depending on the browser, as far as I know. Let me know if that make sense or not. Thanks!

    Thread Starter adopted3

    (@adopted3)

    Hi joerhoney,
    It makes sense the way you designed it.
    However, I just cleared cookies and cache on my mobile browser, forced stop and restart, and tried to visit the website, and it still went straight to the non-browser version (bigbeartools.com). ??
    I’m not sure what it could be.
    Paul

    Plugin Author Joe Rhoney

    (@joerhoney)

    Can you show a screenshot of your Mobile Detect settings page? The one you posted earlier didn’t work for whatever reason.

    Also, what version of AddFunc Mobile Detect and WordPress are you using?

    Thread Starter adopted3

    (@adopted3)

    Hi!

    WP: 4.1.1
    AddFunc Mobile Detect: 1.2

    Also, if you click this link (it’s not an embedded image), you’ll see the settings:
    https://bigbeartools.com/media/settings.png

    Thanks!
    Paul

    Plugin Author Joe Rhoney

    (@joerhoney)

    Ok, you’re settings look right, and you’re all up-to-date. And you have this set up on your desktop website, not your mobile website, correct?

    Do you have any plugins on your mobile website that might be redirecting traffic?

    Thread Starter adopted3

    (@adopted3)

    Hi joerhoney,

    Correct, set up on the desktop website.

    The mobile website is just the simplified Ecwid e-Commerce-only website.

    Not sure what is going on. Thanks for looking into it! ??

    Paul

    Thread Starter adopted3

    (@adopted3)

    I should note that it worked when I first installed the plugin and tried it. I can’t remember what version of plugin or WordPress that was tho…

    Plugin Author Joe Rhoney

    (@joerhoney)

    Ok, thanks. Can you show what your .htaccess file says?

    Thread Starter adopted3

    (@adopted3)

    Hi joerhoney…

    Here’s the .htaccess

    https://pastebin.com/8aHvLKHd

    Plugin Author Joe Rhoney

    (@joerhoney)

    Thanks! I’m going to guesstimate that that’s where your problem is. AddFunc Mobile Detect relies on WordPress’ default .htaccess script to execute it’s redirect at the right moment. If any other scripts run prior to this and send the header (starts the query response, if you will), then it is too late to return a redirect. The redirect is then ignored. The .htaccess file is read by the server first, before any .php files (in any query), so scripts within it take precedence over your WordPress install functionality in the event of conflict. You have a lot of scripts in your .htaccess file. That’s not necessarily bad, but it comes with it’s potential consequences, which can be hard to spot if you’re unfamiliar with what the .htaccess file does/can do.

    This bit (which you have at the end of your .htaccess file) looks like WordPress’ default .htaccess script:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    IMPORTANT: Make a backup of your .htaccess file before making any changes.

    Then…

    You might want to try moving the above script higher up in your .htaccess file and seeing if that solves the issue. Or try moving other scripts below it.

    I’m thinking it’s probably your <File> tags that are preventing some of the <IfModule mod_rewrite.c> from executing. But I’m not all that well versed in the language involved in .htaccess files myself. Personally, I try to leave the .htaccess file alone and stick with plugin solutions.

    So that’s my advise. I’ll be very interested hear how it goes and what works for you when you resolve it. It might even be that you need your .htaccess file to remain as you currently have it and that AddFunc Mobile Detect isn’t the solution for you. But I’ve found that in most cases modifying the .htaccess file isn’t necessary with all the plugin solutions out there.

    Hope that helps. Let me know how it goes.

    Thread Starter adopted3

    (@adopted3)

    Ok, I’ll keep you posted… thanks for looking into it!

    Plugin Author Joe Rhoney

    (@joerhoney)

    Any luck?

    Thread Starter adopted3

    (@adopted3)

    Hi,

    I tried another plugin, and had similar problems, so it’s likely that the redirect is being blocked by my .htaccess file, as you described.

    I’ll probably try a few other things. I’m nervous to modify the .htaccess ??

    Marking this as Resolved, since it isn’t an issue with your plugin.

    Thank you,
    Paul

    Plugin Author Joe Rhoney

    (@joerhoney)

    Ok. Thanks for getting back to me and best of luck to you!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Sometimes doesn't redirect, sometimes does’ is closed to new replies.