我正在尝试将此htaccess文件转换为webconfig,以便我可以设置我的wordpress W3 Total Cache。因为它在我激活minify时不断给我一个错误,它无法读取缓存文件夹的重写规则。
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css M31536000
ExpiresByType application/x-javascript M31536000
</IfModule>
<IfModule mod_mime.c>
AddEncoding gzip .gzip
<Files *.css.gzip>
ForceType text/css
</Files>
<Files *.js.gzip>
ForceType application/x-javascript
</Files>
</IfModule>
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
SetEnvIfNoCase Request_URI \.gzip$ no-gzip
</IfModule>
</IfModule>
<IfModule mod_headers.c>
Header set X-Powered-By "W3 Total Cache/0.9.1.3"
Header set Vary "Accept-Encoding"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp-content/w3tc/min/
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteRule .* - [E=APPEND_EXT:.gzip]
RewriteCond %{REQUEST_FILENAME}%{ENV:APPEND_EXT} -f
RewriteRule (.*) $1%{ENV:APPEND_EXT} [QSA,L]
RewriteRule ^([a-f0-9]+)\/(.+)\.(include(\-(footer|body))?(-nb)?)\.[0-9]+\.(css|js)$ index.php?tt=$1&gg=$2&g=$3&t=$7 [QSA,L]
</IfModule>
有没有人能够使用IIS成功设置W3 Total Cache?
答案 0 :(得分:0)
你也可以这样做,可能不需要工作的W3C。
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<caching enabled="true" enableKernelCache="true" maxCacheSize="1000" maxResponseSize="512000"/>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^index.php$" ignoreCase="false" />
<action type="None" /></rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="." ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" /></rule>
</rules>
</rewrite>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="3.00:00:00" />
</staticContent>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"><scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" dynamicCompressionLevel="4" />
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="application/xaml+xml" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
</httpCompression>
</system.webServer>
</configuration>