WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
Exclude a directory from the htaccess rules (14 posts)

  1. Galerio
    Member
    Posted 3 years ago #

    I have my WordPress on the root of website and I have actived W3TC but its htacces' rules of cache are affecting the behaviour of my forum at /forum directory. In particular when a page of the forum is changed, the browsers show the old page and to see changes you must force a page reload or you must disable browser cache. In this way when you login, then the page shows that you are not logged in, or when you post a message, you can't see the message posted.

    By now I have added a "no-cache header" to my forum's pages, but this is not acceptable.

    How can I exclude the /forum directory at all?

    Thanks

  2. kfawcett
    Member
    Posted 3 years ago #

    Look under the Page Cache settings page. There is a section to specify pages to never cache. Put "forum" in there on its own line.

    That should work.

  3. kfawcett
    Member
    Posted 3 years ago #

    OR /forum/*

  4. Galerio
    Member
    Posted 3 years ago #

    I tried but it doesn't work.
    The option add this to htaccess:

    RewriteCond %{REQUEST_URI} !(\/wp-admin\/|\/xmlrpc.php|\/wp-(app|cron|login|register|mail)\.php|wp-.*\.php|index\.php|/forum/*|forum) [NC,OR]

    I think I have to use \/forum\/ instead of /forum/*.

    Now I try and let you know.

  5. Galerio
    Member
    Posted 3 years ago #

    No, also with \/forum\/ the cached pages are not refreshed by the browser.
    Maybe I have to set the exclusion also in other part. I'll try.

  6. kfawcett
    Member
    Posted 3 years ago #

    Make sure to purge your cache and then refresh your browser at least two times. Then see if it works.

  7. kfawcett
    Member
    Posted 3 years ago #

    maybe add the /forum/* to the "Never Cache" sections in the database cache and object cache settings area also?

  8. Galerio
    Member
    Posted 3 years ago #

    No, nothing, I addedd \/forum\/ to all exclusion fields, but I always have cache problems.

  9. Galerio
    Member
    Posted 3 years ago #

    I have found that the problem is the option
    Viewing: Browser Cache Settings -> HTML -> Set expires header
    With it active, my forum has the refresh issue, without it all is fine.

    So, how can I exlude my forum directory?

    The part of htaccess file that is involved in this problem is within <IfModule mod_mime.c>:

    AddType text/html .html .htm
        AddType text/richtext .rtf .rtx
        AddType image/svg+xml .svg .svgz
        AddType text/plain .txt
        AddType text/xsd .xsd
        AddType text/xsl .xsl
        AddType text/xml .xml

    and within <IfModule mod_expires.c>:

    ExpiresByType text/html A360000
        ExpiresByType text/richtext A360000
        ExpiresByType image/svg+xml A360000
        ExpiresByType text/plain A360000
        ExpiresByType text/xsd A360000
        ExpiresByType text/xsl A360000
        ExpiresByType text/xml A360000

    (theese are the codes added by the option Set expires header for html content).

  10. benherbert
    Member
    Posted 3 years ago #

    Did anyone ever find a solution to this? I have EXACTLY the same problem, but definitely don't want to turn html browser caching off my wordpress site.

  11. Galerio
    Member
    Posted 3 years ago #

    No, I have had to disable the feature.
    If anyone else have the solution, please, write it.

  12. Frederick Townes
    Member
    Plugin Author

    Posted 2 years ago #

    Sorry, unfortunately there's no way to do that "exclusion" in the plugin.

  13. cosmictap
    Member
    Posted 2 years ago #

    Is there a definitive answer here - all we want to do is affirmatively *exclude* the forum subdirectory from browser / page caching.

  14. Frederick Townes
    Member
    Plugin Author

    Posted 2 years ago #

    You can add ExpiresActive off directive to .htaccess directive you need to be excluded from global policies W3TC sets.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic