WordPress.org

Support

Support » Plugins and Hacks » W3 Total Cache » [Resolved] [Plugin: W3 Total Cache] non-www redirect fails with W3TC activated

[Resolved] [Plugin: W3 Total Cache] non-www redirect fails with W3TC activated

  • Before installing W3TC, if I typed in my domain.com (without www) it would automatically redirect to http://www.domain.com. Once activating W3TC, that redirect no longer works. If I deactivate W3TC, it works again.

    With W3TC activated, if I clear all caches and try it, the first time the redirect works, but after that it doesn’t. Is that normal? I know others who have W3TC and their redirect still works, so I’m confused. How do I fix this?

Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Author Frederick Townes

    @fredericktownes

    It’s best to move your redirects tot he top of your .htaccess file to make sure that they are processed first on requests.

    Hmmm, well I haven’t added any redirects myself to my .htaccess, I just see this in there:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    I moved that to above the # BEGIN W3TC Browser Cache, then cleared all caches, but the behavior remains the same. I suppose I could add something like this to my .htaccess:

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

    But I didn’t think I was supposed to have to do this. IOW, I though WordPress automatically took care of that redirect, and indeed it does when W3TC is deactivated.

    I’m a bit confused on this … what am I missing?

    Well…what I showed above is the only Rewrite rules I have in my .htaccess, and I did move those to the top. So why is the redirect working with W3TC deactivated and still not working with W3TC activated?

    Hey, I just noticed this today. I had to install W3 Total Cache on a site because according to my host my site was using to many resources.

    I’m getting the same behavior, the non www domain no longer redirects to the www.

    Plugin Author Frederick Townes

    @fredericktownes

    Can anyone with this issue submit a bug submission form from the support tab of the plugin please?

    I’m a little new at it, but I think I just submitted the bug report. Hope that helps…

    Thanks

    I submitted a bug ticket as well, no response yet. I’m wanting to try CloudFlare, which from my understanding, requires this redirect to be working, so, I’m hoping to get this resolved soon. Otherwise I’ve been very happy with W3TC, I hate the thought of having to switch to another caching plugin!

    thanks,
    Mike

    It’s been a few weeks now … any update? I didn’t receive a reply from the ticket submission.

    thanks,
    Mike

    ditto – any update?

    I’m experiencing the same issue with my site. I just went and turned off caching for my home page under “Page Cache Settings”, and the redirect works fine after that.

    But, that kinda sucks because your homepage is your most visited page. So don’t want to turn that option off. 🙂

    Any updates on this one?

    @parinpatel, did you submit a bug report from the Support section of the W3TC plugin? Any lurkers out there with the same issue, please do the same. Maybe if enough of us submit bug reports they’ll look into this problem.

    @seriocomic, your redirect seems to be working … did you find a work-around, or did you just turn off page caching?

    @mike, yup i did submit a bug report and did some further searching. looks like it was an issue with the order of the redirects in the htaccess, moving it to the top resolves the issue.

    frederick did respond to my email and indicated that it was an issue with the order on the htaccess as well, but by then i had resolved it, so didn’t need to pursue it further.

    have you tried moving your redirect at the beginning of the htaccess?

    Yes, as I stated in my post above, I did move my rewrite rules to the top, and yet it is still not working. I have received no response to the bug tickets I submitted.

    Hi guys I was having the same problem, but finally fixed using the following (make sure the following is ABOVE all of the cache HTACCESS info):

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    RewriteCond %{HTTP_HOST} ^example.com
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]
    </IfModule>
Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘[Resolved] [Plugin: W3 Total Cache] non-www redirect fails with W3TC activated’ is closed to new replies.
Skip to toolbar