web.config 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3. <system.webServer>
  4. <defaultDocument>
  5. <files>
  6. <remove value="index.php" />
  7. <add value="index.php" />
  8. </files>
  9. </defaultDocument>
  10. <rewrite>
  11. <rules>
  12. <rule name="request_filename" stopProcessing="true">
  13. <match url="." ignoreCase="false" />
  14. <conditions logicalGrouping="MatchAll">
  15. <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
  16. <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
  17. </conditions>
  18. <action type="Rewrite" url="index.php" />
  19. </rule>
  20. <rule name="user_error_redirect" stopProcessing="true">
  21. <match url="^(user)/(.*)\.(txt|md|json|yaml|yml|php|php2|php3|php4|php5|phar|phtml|pl|py|cgi|twig|sh|bat)$" ignoreCase="false" />
  22. <action type="Redirect" url="error" redirectType="Permanent" />
  23. </rule>
  24. <rule name="ignore_folders" stopProcessing="true">
  25. <match url="^(\.git|cache|bin|logs|backup|webserver-configs|tests)/(.*)" ignoreCase="false" />
  26. <action type="Redirect" url="error" redirectType="Permanent" />
  27. </rule>
  28. <rule name="system" stopProcessing="true">
  29. <match url="^system/(.*)\.(txt|md|html|htm|shtml|shtm|json|yaml|yml|php|php2|php3|php4|php5|phar|phtml|twig|sh|bat)$" ignoreCase="false" />
  30. <action type="Redirect" url="error" redirectType="Permanent" />
  31. </rule>
  32. <rule name="vendor" stopProcessing="true">
  33. <match url="^vendor/(.*)\.(txt|md|html|htm|shtml|shtm|json|yaml|yml|php|php2|php3|php4|php5|phar|phtml|twig|sh|bat)$" ignoreCase="false" />
  34. <action type="Redirect" url="error" redirectType="Permanent" />
  35. </rule>
  36. </rules>
  37. </rewrite>
  38. </system.webServer>
  39. <system.web>
  40. <httpRuntime requestPathInvalidCharacters="&lt;,&gt;,*,%,&amp;,\,?" />
  41. </system.web>
  42. </configuration>