Support » Plugin: W3 Total Cache » [Plugin: W3 Total Cache] User Agent Groups Settings

  • Resolved sysopsavant


    I’ve been attempting to use various mobile plugins to make our site mobile friendly. I just discovered that by setting up the user agents and installing the Carrington Mobile theme, I can avoid using any plugin and still make the site display pretty well in a mobile theme based on the user agent string. Is there an extensive list of agents I should be using to cover as many mobile devices as possible?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Frederick Townes


    The plugin already ships with most of the high and low level user agents strings for mobile ready.

    For some reason both fields were blank in mine. I reset defaults and got them back. I noticed that I can only set the mobile theme for one group. Which group should I be setting to the Carrington mobile theme? Right now I have the high group set to this. I am testing in firefox with User Agent Switcher and Modify Headers plugin set up to emulate an HTC Legend. So far it seems to pick up the theme change just fine, but I don’t have a large array of phones to test it on. I’m mainly concerned with smart phones as I don’t think many people with a regular cell phone will be trying to visit the site with it.

    Thanks for the help.
    Site is:
    for reference.

    Plugin Contributor Frederick Townes


    Smart phones are the “high” group.

    Thanks for the help.

    Damon Cook


    to continue this conversation… I’ve gone through similar steps in testing mobile plugins (mainly Wp-touch and their compatibility with W3 Total Cache and found that not using WP-Touch at all is easier, however I don’t want to use Carrington Mobile, but want to use my own site…basically redirect users to a subdirectory site I find that when I use the “Redirect Users to…” field in the User Agent area of the W3 Total Cache plugin to try and redirect users to I get a “Safari cannot open this page because too many redirects occur.” on my iPhone. Suggestions?

    Here are my rewrite conditions in my .htaccess file generated by W3 Total Cache:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_USER_AGENT} (240x320|2\.0\ mmp|alcatel|amoi|asus|au\-mic|audiovox|avantgo|benq|bird|blackberry|blazer|cdm|cellphone|danger|ddipocket|docomo|dopod|elaine/3\.0|ericsson|eudoraweb|fly|haier|hiptop|hp\.ipaq|htc|huawei|i\-mobile|iemobile|j\-phone|kddi|konka|kwc|kyocera/wx310k|lenovo|lg|lg/u990|lge\ vx|midp|midp\-2\.0|mmef20|mmp|mobilephone|mot\-v|motorola|netfront|newgen|newt|nintendo\ ds|nintendo\ wii|nitro|nokia|novarra|o2|openweb|opera\ mobi|opera\.mobi|palm|panasonic|pantech|pdxgw|pg|philips|phone|playstation\ portable|portalmmm|ppc|proxinet|psp|pt|qtek|sagem|samsung|sanyo|sch|sec|sendo|sgh|sharp|sharp\-tq\-gx10|small|smartphone|softbank|sonyericsson|sph|symbian|symbian\ os|symbianos|toshiba|treo|ts21i\-10|up\.browser|up\.link|uts|vertu|vodafone|wap|willcome|windows\ ce|windows\.ce|winwap|xda|zte) [NC]
    RewriteRule .* - [E=W3TC_UA:_low]
    RewriteCond %{HTTPS} =on
    RewriteRule .* - [E=W3TC_SSL:_ssl]
    RewriteCond %{SERVER_PORT} =443
    RewriteRule .* - [E=W3TC_SSL:_ssl]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteRule .* - [E=W3TC_ENC:.gzip]
    RewriteCond %{HTTP_USER_AGENT} (acer\\\ s100|android|archos5|blackberry9500|blackberry9530|blackberry9550|cupcake|docomo\\\ ht\\\-03a|dream|htc\\\ hero|htc\\\ magic|htc_dream|htc_magic|incognito|ipad|iphone|ipod|lg\\\-gw620|liquid\\\ build|maemo|mot\\\-mb200|mot\\\-mb300|nexus\\\ one|opera\\\ mini|samsung\\\-s8000|series60\.\*webkit|series60/5\\\.0|sonyericssone10|sonyericssonu20|sonyericssonx10|t\\\-mobile\\\ mytouch\\\ 3g|t\\\-mobile\\\ opal|tattoo|webmate|webos) [NC]
    RewriteRule .* /mobile/ [R,L]
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} =""
    RewriteCond %{REQUEST_URI} \/$
    RewriteCond %{REQUEST_URI} !(\/wp-admin\/|\/xmlrpc.php|\/wp-(app|cron|login|register|mail)\.php|wp-.*\.php|index\.php) [NC,OR]
    RewriteCond %{REQUEST_URI} (wp\-comments\-popup\.php|wp\-links\-opml\.php|wp\-locations\.php) [NC]
    RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|wordpress_\[a\-f0\-9\]\+|wordpress_logged_in) [NC]
    RewriteCond "$1/_index%{ENV:W3TC_UA}%{ENV:W3TC_SSL}.html%{ENV:W3TC_ENC}" -f
    RewriteRule (.*) "/wp-content/w3tc/pgcache/$1/_index%{ENV:W3TC_UA}%{ENV:W3TC_SSL}.html%{ENV:W3TC_ENC}" [L]

    Damon Cook


    well, as an update I’ve found a work-around that works for me, but it might be worthwhile to still get some feedback if it helps us snag a bug if there is one. My solution was to make my /mobile/ sub-directory into a WP theme, which I can then set the User Agent Group Theme option to direct to and not have to use the User Agent Group Redirect option. This seems to work nicely.

    Did you try setting up an actual subdomain? for example which does a single redirect to your actual folder

    I tested this on ours but I did not have a real iPhone to test with. I was using User Agent switching in Firefox.

    Damon Cook


    no I did not try sub-domain, and it would of been my preference, but I don’t have the option to create a sub-domain on my client’s service. I don’t see why sub-directory wouldn’t work though?

    It should. Mine worked fine that way when I first tested it. It really sounds like it is a browser issue. Safari may limit the number of redirections by default. This is generally to keep malicious sites from constantly redirecting your browser. I have Firefox manually set to allow only one redirection on my home computer. I did test my sub-domain this way with no issues.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: W3 Total Cache] User Agent Groups Settings’ is closed to new replies.