web.config 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3. <system.webServer>
  4. <httpProtocol>
  5. <customHeaders>
  6. <add name="Access-Control-Allow-Origin" value="*" />
  7. </customHeaders>
  8. </httpProtocol>
  9. <security>
  10. <requestFiltering allowDoubleEscaping="true" />
  11. </security>
  12. <staticContent>
  13. <clientCache cacheControlMaxAge="1.00:00:00" cacheControlMode="UseMaxAge" />
  14. <mimeMap fileExtension=".md" mimeType="text/plain" />
  15. <mimeMap fileExtension=".json" mimeType="application/json" />
  16. </staticContent>
  17. <rewrite>
  18. <rules>
  19. <rule name="Redirect root and 'latest' to 'latest/en/' ">
  20. <match url="^(latest)?$" />
  21. <action type="Redirect" url="latest/en/" redirectType="Found" />
  22. </rule>
  23. <rule name="Redirect 'latest/{1}' to 'latest/en/{1}' when language is missing from initial url">
  24. <match url="^latest/(.*)" />
  25. <conditions>
  26. <add input="{R:1}" pattern="^(en|jp)(/|$)" negate="true" />
  27. </conditions>
  28. <action type="Redirect" url="latest/en/{R:1}" redirectType="Found"/>
  29. </rule>
  30. <!-- Rename Xenko to Stride for 4.0+ and latest -->
  31. <rule name="Redirect uppercase Xenko to Stride for 4.0+">
  32. <match url="(([4-9]|[1-9]\d+)\.\d*|latest)/(.*)(Xenko)(.*)" />
  33. <action type="Redirect" redirectType="Permanent" url="{R:1}/{R:3}Stride{R:5}" />
  34. </rule>
  35. <rule name="Redirect lowercase xenko to stride for 4.0+">
  36. <match url="(([4-9]|[1-9]\d+)\.\d*|latest)/(.*)(xenko)(.*)" />
  37. <action type="Redirect" redirectType="Permanent" url="{R:1}/{R:3}stride{R:5}" />
  38. </rule>
  39. <!-- Update this rule when there is a new Xenko doc version released -->
  40. <rule name="Rewrite URL for latest documentation">
  41. <match url="latest(.*)" />
  42. <action type="Rewrite" url="%deployment_version%/{R:1}" />
  43. </rule>
  44. </rules>
  45. </rewrite>
  46. <httpErrors errorMode="Custom">
  47. <remove statusCode="404"/>
  48. <error statusCode="404" path="%deployment_version%\en\404.html" responseMode="File" />
  49. </httpErrors>
  50. </system.webServer>
  51. </configuration>