Title: Sometimes doesn&#039;t redirect, sometimes does
Last modified: August 22, 2016

---

# Sometimes doesn't redirect, sometimes does

 *  Resolved [adopted3](https://wordpress.org/support/users/adopted3/)
 * (@adopted3)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/)
 * Using WP 4.1.1 and AddFunc Mobile Detect 1.2.
 * Only tested on my Android phone. Sometimes it redirects to the m. subdomain, 
   but sometimes it doesn’t.
 * Here’s our settings page:
    [http://bigbeartools.com/media/settings.png](http://bigbeartools.com/media/settings.png)
 * Thx
 * [https://wordpress.org/plugins/addfunc-mobile-detect/](https://wordpress.org/plugins/addfunc-mobile-detect/)

Viewing 15 replies - 1 through 15 (of 15 total)

 *  Thread Starter [adopted3](https://wordpress.org/support/users/adopted3/)
 * (@adopted3)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811116)
 * Just tested on an iPhone… same problem 🙁
 *  Plugin Author [Joe Rhoney](https://wordpress.org/support/users/joerhoney/)
 * (@joerhoney)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811180)
 * 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](https://wordpress.org/support/users/adopted3/)
 * (@adopted3)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811187)
 * 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](https://wordpress.org/support/users/joerhoney/)
 * (@joerhoney)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811190)
 * 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](https://wordpress.org/support/users/adopted3/)
 * (@adopted3)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811191)
 * 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:
   
   [http://bigbeartools.com/media/settings.png](http://bigbeartools.com/media/settings.png)
 * Thanks!
    Paul
 *  Plugin Author [Joe Rhoney](https://wordpress.org/support/users/joerhoney/)
 * (@joerhoney)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811192)
 * 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](https://wordpress.org/support/users/adopted3/)
 * (@adopted3)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811193)
 * 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](https://wordpress.org/support/users/adopted3/)
 * (@adopted3)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811194)
 * 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](https://wordpress.org/support/users/joerhoney/)
 * (@joerhoney)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811196)
 * Ok, thanks. Can you show what your .htaccess file says?
 *  Thread Starter [adopted3](https://wordpress.org/support/users/adopted3/)
 * (@adopted3)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811197)
 * Hi joerhoney…
 * Here’s the .htaccess
 * [http://pastebin.com/8aHvLKHd](http://pastebin.com/8aHvLKHd)
 *  Plugin Author [Joe Rhoney](https://wordpress.org/support/users/joerhoney/)
 * (@joerhoney)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811199)
 * 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](https://wordpress.org/support/users/adopted3/)
 * (@adopted3)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811201)
 * Ok, I’ll keep you posted… thanks for looking into it!
 *  Plugin Author [Joe Rhoney](https://wordpress.org/support/users/joerhoney/)
 * (@joerhoney)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811210)
 * Any luck?
 *  Thread Starter [adopted3](https://wordpress.org/support/users/adopted3/)
 * (@adopted3)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811213)
 * 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](https://wordpress.org/support/users/joerhoney/)
 * (@joerhoney)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811214)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/addfunc-mobile-detect_1c0d1e.svg)
 * [AddFunc Mobile Detect](https://wordpress.org/plugins/addfunc-mobile-detect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/addfunc-mobile-detect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/addfunc-mobile-detect/)
 * [Active Topics](https://wordpress.org/support/plugin/addfunc-mobile-detect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/addfunc-mobile-detect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/addfunc-mobile-detect/reviews/)

 * 15 replies
 * 2 participants
 * Last reply from: [Joe Rhoney](https://wordpress.org/support/users/joerhoney/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/sometimes-doesnt-redirect-sometimes-does/#post-5811214)
 * Status: resolved