Supercache rewrite rules incorrect if blog not at top level
-
If the blog isn’t installed at the top level of the website, the automatically-generated rewrite rules for WP Super Cache don’t take this into account. For example, mine is at https://www.hyperborea.org/journal/ because it was added to my existing website. Super Cache generates files using the full path, but the rewrite rules don’t take that first directory into account.
For Super Cache to work, it should be looking for static HTML files here:
%{DOCUMENT_ROOT}/journal/wp-content/cache/supercache/%{HTTP_HOST}/journal/$1index.html
Instead, the automatically generated rules look here:
%{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1index.html
Naturally, it doesn’t find the cached files, so it doesn’t load the file from the super cache.
It’s also set to rewrite to the wrong path (same issue as above), but since it never fulfills the condition in the first place, it never tries to redirect to a nonexistent file.
I’ve corrected my .htaccess file, but it would be better if, when generating the rules, the plugin could include the path to the blog itself.
- The topic ‘Supercache rewrite rules incorrect if blog not at top level’ is closed to new replies.