我已经为我的 WordPress 网络安装了 W3 总缓存,除了 Minifier 部分之外,一切都运行良好。
当设置为“自动”时,插件需要访问此路径:
/wp-content/cache/minify/000006/M9AvLqnMSQUA.css
但是它中断了,因为 Wordpress 将它重定向到 404.php 模板,认为它是一个页面/永久链接。
我可以在我的 .htaccess 中放入什么内容或更改权限以允许直接访问此路径,以便缩小脚本可以工作吗?
到目前为止,这是我的 .htaccess 文件中的内容(包括所有总缓存设置)
# BEGIN W3TC Minify cache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^[_0-9a-zA-Z-]+/wp-content/cache/minify/[0-9]+/w3tc_rewrite_test$ /wp-content/plugins/w3-total-cache/pub/minify.php?w3tc_rewrite_test=1 [L]
</IfModule>
# END W3TC Minify cache
# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
<IfModule mod_mime.c>
# DEFLATE by extension
AddOutputFilter DEFLATE js css htm html xml
</IfModule>
</IfModule>
# END W3TC Browser Cache
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress