Welcome to WebmasterWorld Guest from 23.22.79.235

Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

Wp Super Cache serve non-cache to specific User Agent?

   
8:41 pm on Feb 19, 2013 (gmt 0)



I'm using Wp Super Cache which is a very important plugin for my site, basically I can't run my website without it and not with other cache plugin. What I want to do is somehow serve non-cached to Googlebot using .htaccess with something like rewritecond user agent !googlebot, but I don't know how to do this. I already search the internet, couldn't find anything that helps on my level. Does anyone know how to do this?
7:18 am on Feb 20, 2013 (gmt 0)



This is what I've tried and didn't worked

RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
# ADDED THIS LINE TO PASS-THROUGH USER AGENTS
RewriteCond %{HTTP_USER_AGENT} !(Googlebot|Google|Adsense)
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz -f
RewriteRule ^(.*) /wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz [L]

RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
# ADDED THIS LINE TO PASS-THROUGH USER AGENTS
RewriteCond %{HTTP_USER_AGENT} !(Googlebot|Google|Adsense)
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html -f
RewriteRule ^(.*) /wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html [L]
6:05 pm on Feb 20, 2013 (gmt 0)

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Hello stefan1st, welcome to WebmasterWorld.

This might be considered cloaking by Google. Serving the user something different than what Googlebot gets is classic and has resulted in sites being banned. You may want to review this Webmaster Tools video: [support.google.com...]
6:53 pm on Feb 20, 2013 (gmt 0)



Heh, hi lorax.

I don't think in this case it's about cloaking because Mobile user agents get a dynamic version of the site, why wouldn't Google get one too? In the end visitors and google see the same thing. I can only offer a cached version of the site to visitors because I have heavy traffic and my server would die in ~ 10 minutes. I don't think it's wrong, I don't intend to do anything blackhatish :)