Support » Plugin: WP Super Cache » [Plugin: WP Super Cache] After upgrade, caching non-www homepage

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi.
    Whether I enter http://www.timesofisrael.com or http://timesofisrael.com I always land on http://www.timesofisrael.com, so it seems to be working expected/before?

    Plugin Author Donncha O Caoimh

    (@donncha)

    Redirects for me too. Perhaps someone had changed to the no-www briefly on the site and the front page had been cached?

    Marventus, Donncha:

    Try going to http://timesofisrael.com now and you will see what I mean.

    The way this works is:

    if there is NO timesofisrael.com folder in wp-content/cache/supercache, then it is indeed redirected as normal to http://www.timesofisrael.com

    However, if there is one, then the redirect stops working and the homepage version is the old one.

    I do not know how and under what conditions the www-less cached version gets created.

    I constantly delete the timesofisrael.com folder under wp-content/cache/supercache but right now I’m leaving it there so you can see it for yourself…

    Thanks,

    Bira

    Plugin Author Donncha O Caoimh

    (@donncha)

    I have seen this very occasionally but it shouldn’t happen. A sure fire way of fixing it is by adding mod_rewrite rules to your .htaccess file that redirect the no-www to the www hostname.

    This looks like a good explanation of how to do it:
    http://www.thesitewizard.com/apache/redirect-domain-www-subdomain.shtml

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^timesofisrael\.com$ [NC]
    RewriteRule ^(.*)$ http://www.timesofisrael.com/$1 [R=301,L]

    Hi Donncha,

    Thanks for your quick reply.

    The .htaccess has this at the start:

    BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    #If you serve pages from behind a proxy you may want to change 'RewriteCond %{HTTPS} on' to something more sensible

    If I alter it to this:

    BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^timesofisrael\.com$ [NC]
    RewriteRule ^(.*)$ http://www.timesofisrael.com/$1 [R=301,L]
    RewriteBase /
    #If you serve pages from behind a proxy you may want to change 'RewriteCond %{HTTPS} on' to something more sensible

    Would it not be overwritten if/when super cache is upgraded or changed?

    Alternatively, is there anywhere else I should put those lines?

    Thanks a lot,

    Bira

    Plugin Author Donncha O Caoimh

    (@donncha)

    Put the extra lines above the “BEGIN WPSuperCache” line, and move the “RewriteEngone On” line up too.

    Excellent, that works. Thank you so much!

    Glad to hear that. You should check to see if the plugin did not add its own rule for that, and if it did, delete it so that it doesn’t collide with the one provided by Donncha.
    Also, please don’t forget to mark this thread as resolved whenever you can.
    Thanks!

    Done, thanks 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: WP Super Cache] After upgrade, caching non-www homepage’ is closed to new replies.