Super Cache rewrite rules causing endless loop ?
-
Hi Donncha et al. ,
Trying your excellent plugin (which does work fine so it seems) I noticed errors in the server errorlogfile like this one:
[Fri Mar 14 15:33:08 2008] [error] [client 82.99.30.28] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use ‘RewriteOptions MaxRedirects’ to increase the limit if neccessary.
I am on a shared host and have no clue why, when or how these errors are caused. So I asked the server admin what could be causing these. He replied that it was probably caused by rewrite rules beginning with / and pointed me at http://www.sitepoint.com/print/mod_rewrite-no-endless-loops for more info.
Now the date on that page is rather old, so it might not be valid anymore… Or does the server admin have a point here? Should the rules maybe be (notice the missing / at the two end rules):
RewriteCond %{QUERY_STRING} !.*s=.* RewriteCond %{HTTP_COOKIE} !^.*comment_author_.*$ RewriteCond %{HTTP_COOKIE} !^.*wordpressuser.*$ RewriteCond %{HTTP_COOKIE} !^.*wp-postpass_.*$ RewriteCond %{HTTP:Accept-Encoding} gzip RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f RewriteRule ^(.*) wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L] RewriteCond %{QUERY_STRING} !.*s=.* RewriteCond %{HTTP_COOKIE} !^.*comment_author_.*$ RewriteCond %{HTTP_COOKIE} !^.*wordpressuser.*$ RewriteCond %{HTTP_COOKIE} !^.*wp-postpass_.*$ RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f RewriteRule ^(.*) wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]I have tested this on my WP_MU 1.3.3 and it seems to work fine… I have taken no long time to wait for new error lines in the logfile but at least the caching works.
The WP_MU installation is in the httpdocs (root) so I have
RewriteBase /in my .htaccess. No idea how these changes (if at all relevant) would impact installations in a subdir (I saw a thread about RewriteBase issues that may be related/affected?)…Can you, or anyone else, advise me on this matter?
Thanks 🙂
The topic ‘Super Cache rewrite rules causing endless loop ?’ is closed to new replies.