[Plugin: WP Super Cache] Cache Causes re-direct to fail
-
Hey there,
I’m using the latest version of wp-super-cache, updated from the 0.6.4 version a few days ago, and I’m noticing some strange behavior.
I’m using the Permalink Redirect plugin (https://scott.yang.id.au/code/permalink-redirect/) which does a great job at redirecting everything, non-www to www, adds the ending “/” etc.
But since updating to 0.6.6 I have noticed that if I go to my site without the www, it will redirect as it should. BUT then, if I open a new tab, enter the same url (with out the www again) it does not redirect.
After looking at the cache folder, as far as I can tell, wp-super-cache is making a cached version of the page when I go to the non www page for the first time, and at this time I get correctly redirected. But the 2nd time I access this url the cached version of the non www is served.
In the super cached folder im now getting some https://www.mysite.com folders, where before I wasn’t.
SEO and duplicate content is very important to me, so this is a little annoying.
As a test, I cleared my cache and entered my sites url (without www) into https://www.seologic.com/webmaster-tools/url-redirect.php and it first reports a “HTTP/1.1 301 Moved Permanently”, but on the second time, HTTP/1.1 200 OK is reported. Proving this problem.
I believe it to be a problem with wp-super-cache rather than the re-direct plugin, as it only happen when wp-super-cache is enabled and after a cached page has been created… and since upgrading from 0.6.4.
Sorry for the long, post, just trying to provide all details I can.
Below is my .htaccess file.
===
# BEGIN WPSuperCache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
AddDefaultCharset UTF-8
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} !.*s=.*
RewriteCond %{QUERY_STRING} !.*p=.*
RewriteCond %{QUERY_STRING} !.*attachment_id=.*
RewriteCond %{QUERY_STRING} !.*wp-subscription-manager=.*
RewriteCond %{HTTP_COOKIE} !^.*(comment_author_|wordpress|wp-postpass_).*$
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} !.*s=.*
RewriteCond %{QUERY_STRING} !.*p=.*
RewriteCond %{QUERY_STRING} !.*attachment_id=.*
RewriteCond %{QUERY_STRING} !.*wp-subscription-manager=.*
RewriteCond %{HTTP_COOKIE} !^.*(comment_author_|wordpress|wp-postpass_).*$
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]
</IfModule>
# END WPSuperCache# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule># END WordPress
Many thanks for your time, and great work on the plugin!
Cheers,
Matt
- The topic ‘[Plugin: WP Super Cache] Cache Causes re-direct to fail’ is closed to new replies.