Its not a static page is it?
tim
Thanks @kwoodfriend. I looked at the thread you mentioned and there is a high chance that my problem is indeed related to .htaccess and it’s handling by Apache. My friend’s site is a bit tricky, she has a bunch of non-WordPress static pages (incl. homepage index.php) and a WordPress blog installed in a subfolder. As a result, there are two .htaccess files, one in root folder (to control behaviour of static pages) and another on in WP blog folder (this is the one that is used/modified by Wordfence). The blog’s main page is a default page with the list of post excerpts and this page doesn’t get cached. All other WP pages and posts get cached just fine. I mentioned above that I setup a test blog with the same theme/plugins and the test blog is cached without any issues. Well, the difference is that the test blog doesn’t have any static pages, so there is no second .htaccess file…
@kwoodfriend, in your other post you mentioned that in order to mitigate this problem you modified WordPress’s index.php file and added the logic that mimics the logic Falcon adds to the .htaccess. Can you share your code here, so that I can try to use it to see if it fixes the problem?
Here are the 2 .htaccess files:
Blog: http://paste.ie/view/06c99457
Root (modified for privacy reasons): http://paste.ie/view/29219bd5
@misha5102 — Do you know what version of Apache the site is using?
Also, I’m working on an issue with my workaround. The homepage still shows a cached page, even if you’re logged in, which is not the intended behavior. Once I get that fixed, I’ll post the solution I used.
@kwoodfriend, the Apache version is 2.4.7
I did more testing and almost confident that @kwoodfriend is correct in his diagnosis – this was broken with Apache upgrade to 2.4. I basically duplicated the site with identical configuration (re WP) on another host and everything works fine there. The difference? Apache version of another host is 2.2.25…
@misha5102, just any update on the workaround. I should have it ready tomorrow. Just need to tweak a few things to make it generic enough so you can use it!
@kwoodfriend, any progress with the workaround?
@misha5102, thanks for the reminder!
Here’s a gist of what we’re using for the workaround. You will need updated the $targetDomain
variable to match your domain. You might also need to tweak lines 24 and 37 to match your setup, since WP is in a subfolder. Let me know how it goes!
https://gist.github.com/kwoodfriend/079ea35f6f496d053a5f
@kwoodfriend Thanks a lot! Sorry for the stupid question but where do I insert this code (after changing folders)? Into header.php?
@misha5102 This should go in the main WordPress index.php file. So, for your friend’s site, it would be blog/index.php
(or what ever the subfolder name is for the site).
Make sure to back up the index.php file first!
@kwoodfriend, you are a genius! I updated my friend’s blog and everything works fine now, everything is served from cache incl. main blog page. Thanks again.
[I will mark this topic as resolved]
Thanks @misha5102! Let me know if you run into issues with it. I’d like to keep the gist updated for any issues.