Enabling Super Cache Loads Mobile Site??
-
I’m quite confused.
Just enabled super cache with cache rebuild and mobile support ticked and my website loads as a mobile website.
If I turn it off or half on, then it will load the Website as it should.
I didn’t program the website or install wordpress so I’m at a loss as to why it’s happening, and I really need it enabled considering how busy we are.
Can anybody help?
-
bump.
Ok this is weird…
I disabled mobile support, cleared cache, re-enabled and then it worked.
However, several hours later it turned back into a mobile site and I had to do that procedure again for it to work!
Hello,
Sorry for the sparse information.
I do know my WP version is old but I didn’t program it and I don’t want to risk upgrading it in the event I break all my plugins. Not to mention, I’m not the most technical savy person there is!
It seems that for mobile, we are using the following: WordPress Mobile Plugin v1.3.
Is there any other information you need?
WP Super Cache version is 0.9.5
The short answer is this: Upgrade to the latest version from 0.9.5 and enable mobile device support.
In your blogs .htaccess file you need to have WP Super Cache exclude the user agents for mobile devices. This way regular browsers get served cached files and mobile devices don’t.
In my .htaccess file I have this line
RewriteCond %{HTTP_USER_AGENT} !^.*(Android|2.0\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile|iPhone|iPod|KYOCERA/WX310K|LG/U990|MIDP-2.0|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|Playstation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|Windows\ CE|WinWAP).*
Which is not only lengthy but says a condition for rewriting to the cached version is that the HTTP_USER_AGENT is NOT one of those listed. This way the plugin will not create cached version for mobile devices and the .htaccess will ensure that mobile devices don’t get served the non-mobile version of your pages.
I’m probably explaining it poorly but more info is over here:
This is really annoying now. I updated wordpress to the latest version yesterday, and all plugins.
However, the same problem exists. I had super cache on with mobile support turned on.. same problem…. turned it off… same problem.
The annoying thing is I can never see this problem and have to go through a proxy to see it, and even then its sometimes not accurate.
Today https://www.wrestling-edge.com was normal for me BUT https://wrestling-edge.com showed the mobile website. I disabled the WordPress Mobile plugin to see if that would completely eliminate the problem, but https://wrestling-edge.com still showed up in mobile format with the white page and headlines. Only when I completely disabled supercache in the plugins section it went.
I’m really annoyed here and don’t know what to do and because it is appearing different to everyone it’s really hard to find out when there is actually a problem with it or not.
Can anyone advise further? I’m desperate here. It seems that the only solution to completely fix this is completely disable super cache and I don’t want to do that.
Below is my root .htaccess file:
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC] RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC] RewriteRule ^feed/?([_0-9a-z-]+)?/?$ https://www.wrestling-edge.com/feed [R=302,NC,L] </IfModule> AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch bMSIE !no-gzip !gzip-only-text/html ErrorDocument 404 /wordpress/index.php?error=404 # BEGIN WPSuperCache <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / AddDefaultCharset UTF-8 RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{QUERY_STRING} !.*=.* RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$ RewriteCond %{HTTP:Accept-Encoding} gzip RewriteCond %{DOCUMENT_ROOT}/wordpress/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f RewriteRule ^(.*) /wordpress/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{QUERY_STRING} !.*=.* RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$ RewriteCond %{DOCUMENT_ROOT}/wordpress/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f RewriteRule ^(.*) /wordpress/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L] </IfModule> # END WPSuperCache # BEGIN WordPress <IfModule mod_rewrite.c> RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
Below is my .htaccess file from the WordPress folder:
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC] RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC] RewriteRule ^feed/?([_0-9a-z-]+)?/?$ https://feeds2.feedburner.com/catswhocode [R=302,NC,L] </IfModule> AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch bMSIE !no-gzip !gzip-only-text/html ErrorDocument 404 /wordpress/index.php?error=404 # BEGIN WPSuperCache <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / AddDefaultCharset UTF-8 RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{QUERY_STRING} !.*=.* RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$ RewriteCond %{HTTP:Accept-Encoding} gzip RewriteCond %{DOCUMENT_ROOT}/wordpress/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f RewriteRule ^(.*) /wordpress/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{QUERY_STRING} !.*=.* RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$ RewriteCond %{DOCUMENT_ROOT}/wordpress/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f RewriteRule ^(.*) /wordpress/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L] </IfModule> # END WPSuperCache # BEGIN WordPress <IfModule mod_rewrite.c> RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
It seems that this problem mainly exists for people in the States..
Let me know if anymore info is needed.. its currently showing up as mobile on most proxies I am testing with.
Bizzare. If you’ve disabled the mobile WordPress plugin that content should not get served.
Try this: make a full file backup of you current directories and keep that in a safe place. That is your safety net and if something goes horribly wrong you can put the files back.
https://codex.www.ads-software.com/WordPress_Backups
A database backup would be a great idea too.
https://codex.www.ads-software.com/Backing_Up_Your_Database
https://codex.www.ads-software.com/Restoring_Your_Database_From_BackupNow go into you wp-content/plugins and delete the WordPress mobile plugin and it’s directory. If there is a wp-content/themes portion, delete that too (seriously, make that complete file backup!)
Once that’s all done, edit your .htacces files and remove all the text between and including # BEGIN WPSuperCache and # END WPSuperCache.
Now go into wp-content/cache and delete all files and folders within that directory. This is to make sure that there is no stale cache files left.
The point of this is to totally remove the mobile WordPress plugin and make it so that WP SuperCache files are not being served.
This is a temporary condition and if you now check your blog again, no mobile content should or can be served from your site.
Once you have confirmed that your site is serving the correct version NOW re-create the .htaccess portion using the WP SuperCache admin page. That should re-enable WP SuperCache pages being served and you should be mobile version free.
Once that’s stable and sane, then you can investigate putting back a mobile version of your site.
Hey,
Thanks for that advice. I have done all this, and will see if it solves the problem ??
Given that automatic update of .htaccess file doesn’t work even if you CHMOD it to 777 and remove the super cache part prior, it seems that the only way to enable mobile support is by entering the line manually into the .htaccess file, but nobody tells you where exactly that line is supposed to go. Is it gonna work if I place it randomly somewhere within the file?
- The topic ‘Enabling Super Cache Loads Mobile Site??’ is closed to new replies.