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

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

    Thread Starter Biranit

    (@biranit)

    Marventus, Donncha:

    Try going to https://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 https://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

    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:
    https://www.thesitewizard.com/apache/redirect-domain-www-subdomain.shtml

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

    (@biranit)

    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 ^(.*)$ https://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

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

    Thread Starter Biranit

    (@biranit)

    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!

    Thread Starter Biranit

    (@biranit)

    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.