web.config 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3. <system.webServer>
  4. <rewrite>
  5. <rules>
  6. <!-- http website -->
  7. <rule name="w3tc_pagecache" stopProcessing="true">
  8. <match url="(.*)" />
  9. <conditions logicalGrouping="MatchAll">
  10. <add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
  11. <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" />
  12. <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress|wp-postpass_).*$" negate="true" />
  13. <add input="{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/{HTTP_HOST}/{R:1}_index.html"
  14. matchType="IsFile" />
  15. </conditions>
  16. <action type="Rewrite" url="wp-content/cache/page_enhanced/{HTTP_HOST}/{R:1}_index.html" />
  17. </rule>
  18. <!-- https website -->
  19. <rule name="w3tc_pagecache_ssl" stopProcessing="true">
  20. <match url="(.*)" />
  21. <conditions logicalGrouping="MatchAll">
  22. <add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
  23. <add input="{QUERY_STRING}" pattern=".*=.*" negate="true" />
  24. <add input="{HTTP_COOKIE}" pattern="^.*(comment_author_|wordpress|wp-postpass_).*$" negate="true" />
  25. <add input="{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/{HTTP_HOST}/{R:1}_index_ssl.html"
  26. matchType="IsFile" />
  27. </conditions>
  28. <action type="Rewrite" url="wp-content/cache/page_enhanced/{HTTP_HOST}/{R:1}_index_ssl.html" />
  29. </rule>
  30. <!-- minify, disk engine -->
  31. <rule name="w3tc_rewrite_test" stopProcessing="true">
  32. <match url="/wp-content/cache/minify/w3tc_rewrite_test" />
  33. <conditions>
  34. <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
  35. <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
  36. </conditions>
  37. <action type="Rewrite" url="index.php" />
  38. </rule>
  39. <rule name="w3tc-minify-file" stopProcessing="true">
  40. <match url="/wp-content/cache/minify/(.+\.(css|js))$" />
  41. <conditions>
  42. <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
  43. </conditions>
  44. <action type="Rewrite" url="index.php" />
  45. </rule>
  46. <rule name="WordPress" patternSyntax="Wildcard">
  47. <match url="*"/>
  48. <conditions>
  49. <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
  50. <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
  51. </conditions>
  52. <action type="Rewrite" url="index.php"/>
  53. </rule>
  54. </rules>
  55. </rewrite>
  56. <!-- leverage browser cache -->
  57. <staticContent>
  58. <clientCache cacheControlMaxAge="30.00:00:00" cacheControlMode="UseMaxAge"/>
  59. </staticContent>
  60. </system.webServer>
  61. </configuration>