Replies: 0
Hello i’am implemented the original .htacces’s W3TC Configuration for more than 7 month.
# BEGIN W3TC Minify cache
<IfModule mod_mime.c>
AddType text/css .css_gzip
AddEncoding gzip .css_gzip
AddType application/x-javascript .js_gzip
AddEncoding gzip .js_gzip
</IfModule>
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
SetEnvIfNoCase Request_URI \.css_gzip$ no-gzip
SetEnvIfNoCase Request_URI \.js_gzip$ no-gzip
</IfModule>
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css M10713600
ExpiresByType application/x-javascript M10713600
</IfModule>
<IfModule mod_headers.c>
Header set Vary "Accept-Encoding"
</IfModule>
# END W3TC Minify cache
# BEGIN W3TC Minify core
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp-content/cache/minify/
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteRule .* - [E=APPEND_EXT:_gzip]
RewriteCond %{REQUEST_FILENAME}%{ENV:APPEND_EXT} -F
RewriteRule (.*) $1%{ENV:APPEND_EXT} [L]
RewriteRule ^(.+\.(css|js))$ /index.php [L]
</IfModule>
# END W3TC Minify core
After i move to unmanaged VPS, i found this configuration make error
[Mon May 18 00:10:15.806084 2020] [core:error] [pid 28361] [client 114.125.100.87:52499] AH00125: Request exceeded the limit of 10 subrequest nesting levels due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: ...
Then i set to LogLevel debug in httpd.conf
This problem come
[Mon May 18 03:54:08.450949 2020] [core:debug] [pid 5046] core.c(3848): [client 139.0.199.184:49631] AH00121: r->uri = /wp-content/script/gzip/xxxxxx.v1.min.js_gzip_gzip_gzip_gzip_gzip_gzip_gzip_gzip_gzip_gzip, referer: ~
I resolved the issue
Using this configuration
<IfModule mod_headers.c>
# Serve gzip compressed CSS files if they exist
# and the client accepts gzip.
RewriteCond "%{HTTP:Accept-encoding}" "gzip"
RewriteCond "%{REQUEST_FILENAME}\.gz" -s
RewriteRule "^(.*)\.css" "$1\.css\.gz" [QSA]
# Serve gzip compressed JS files if they exist
# and the client accepts gzip.
RewriteCond "%{HTTP:Accept-encoding}" "gzip"
RewriteCond "%{REQUEST_FILENAME}\.gz" -s
RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA]
# Serve correct content types, and prevent mod_deflate double gzip.
RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1]
RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1]
<FilesMatch "(\.js\.gz|\.css\.gz)$">
# Serve correct encoding type.
Header append Content-Encoding gzip
# Force proxies to cache gzipped &
# non-gzipped css/js files separately.
Header append Vary Accept-Encoding
</FilesMatch>
</IfModule>
This script was created by Mattias Greniad, i test the script work in Apache 2.4
I just implemented the script for my custom per-compiled file using 7z software to create static .gz. The error resolved by its script.
Can w3TC, analyze the .htaccess script and also W3TC can make the plugin more compatible with other server management (i am using direct admin)
Thanks