W3 Total Cache
Won't redirect to www. any more (9 posts)

  1. StalkerB
    Posted 5 years ago #

    Not sure how this works exactly but...

    With W3TC on if a user tries to go to the non www. version of the site they can, so http://example.com is resolved and doesn't go to http://www.example.com

    This causes issues for some scripts we're running which view the non-www version to be a different site and won't run.

    If I empty all caches and reload or go to http://example.com it does redirect me to http://www.example.com but subsequent visits to http://example.com don't redirect.

    With W3TC off/removed from the .htaccess the redirect always works.

    Any ideas what's causing it?


  2. Klark0
    Posted 5 years ago #


    I also have the same problem. I might also add that it may be affecting adsense relevancy on the pages WITH the www. The mediapartners bot isn't browsing those pages. *scratches head*.

  3. Klark0
    Posted 5 years ago #

    Ok I dropped this into htacesss BEFORE the W3TC and wordpress rules.

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

    all urls have the www, now. But now i'm wondering if that is best. Does that code need to wrapped in anything? At the bottom where the wordpress rules are, i have "<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase / ........."
    When i try to merge them, the homepage url displays a direct link to the W3TC page cache index file instead of just http://www.domain.com

  4. Frederick Townes
    Plugin Author

    Posted 5 years ago #

    You can write it in a IfModule block if you want, but it's ok as is.

  5. extremecarver
    Posted 5 years ago #

    I have the same problem, but cannot not solve it with the above RewriteCond/RewriteRule.

    I am using http://striderweb.com/nerdaphernalia/features/virtual-multiblog/
    to serve my to websites ( http://openmtbmap.org and http://www.velomap.org )from the same installation on my dedicated root server.

    I have to enable all plugins on both sites, on my main site (openmtmbap) everything works fine, but on my "www" velomap.org site, also if activated and supposedly working, pages are not cached (saying cookie rejected) and users typing adresses without www get shown an error page. If I use the above rules, then people of both my sites get redirected to the www. site mentioned in the rewriterule.

    I am not sure if virtual multiblog for wordpress is to blame, but due to this problem I am not able to use W3TC (too much work to disable virtual multiblog for wordpress once setup and create and service two seperate wordpress installations, the new wordpress default multiblog does not cut it for me)....

    Otherwise, compared to when I looked up W3TC about 6 month ago, great that qtranslate is now compatible and performance seems to be much better than back then. Now W3TC is more performant than wp supercache plus using xcache (with W3TC using xcache where advised, else using disk/disk enhance only performance is not so great...)

  6. Frederick Townes
    Plugin Author

    Posted 5 years ago #

    Can you submit a bug submission form from the support tab of the plugin?

  7. extremecarver
    Posted 5 years ago #

    Bug support added. One further note: the following file is allways conflicting:

    because this line: Header set X-Pingback "http://www.velomap.org/xmlrpc.php" vice versa Header set X-Pingback "http://openmtbmap.org/xmlrpc.php"
    has to be working for both virtual multiblog sites, but will only ever be correct for either (if rewritten, then it will be wrong for the other site...)

    Sorry I have to deactivate W3 total cache again, cause too many people would be bummed about ending up on the wrong page (last time about 500 people in 24hrs... as I get about 6000 visitors a day on both pages together..)

    The thing with the virtual multiblog to understand is, that all files will only exist once, only database for each site unique. I think this causes the probs (wp supercache or the much better wp supercache plus is fine though with this situation)

    # BEGIN W3TC Page Cache
    AddDefaultCharset UTF-8
    <IfModule mod_mime.c>
    AddType text/html .gzip
    AddEncoding gzip .gzip
    <IfModule mod_deflate.c>
    SetEnvIfNoCase Request_URI \.gzip$ no-gzip
    <IfModule mod_headers.c>
    Header set X-Pingback "http://www.velomap.org/xmlrpc.php"
    Header set X-Powered-By "W3 Total Cache/"
    Header set Vary "Accept-Encoding, Cookie"
    # END W3TC Page Cache

  8. DanMichel
    Posted 4 years ago #

    ok, the redirect works but 'websitegrader' tells me 'Permanent Redirect Not Found' still

  9. Frederick Townes
    Plugin Author

    Posted 4 years ago #

    I recommend you ask your host about that case.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • W3 Total Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic