Quantcast
Channel: WordPress.org Forums » [W3 Total Cache] Support
Viewing all articles
Browse latest Browse all 19302

IntricatePixels on "[Plugin: W3 Total Cache] Random blank pages or incorrectly formatted cached pages served"

$
0
0

For anyone else running into this same issue, to fix the problem with W3 Total Cache caching blank pages, I added a url rewrite rule to our server config so that it always add a trailing slash to directories. So, if you type http://www.mywebsite.com/section you're (301) redirected to http://www.mywebsite.com/section/ (note trailing slash at the end). This is performed before W3 Total Cache caches the page.

Depending on your server configuration, you want to do this in your htaccess file (apache) or your web.config using a rewrite rule (IIS). In IIS you need to have the URL Rewrite Module installed in order to use rewrite rules.

This is what my IIS rewrite rule looks like in web.config (make sure this comes before any wordpress rewrite rules):

<rule name="Add trailing slash" stopProcessing="true">
  <match url="(.*[^/])$" />
  <conditions>
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    <add input="{REQUEST_FILENAME}" pattern="(.*?)\.html$" negate="true" />
    <add input="{REQUEST_FILENAME}" pattern="(.*?)\.aspx$" negate="true" />
  </conditions>
  <action type="Redirect" redirectType="Permanent" url="{R:1}/" />
</rule>

My other issue related to incorrectly formatted cached pages is related to another issue with the Ubermenu plugin and W3 Total Cache.


Viewing all articles
Browse latest Browse all 19302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>