Chris@0
|
1 <?xml version="1.0" encoding="UTF-8"?>
|
Chris@0
|
2 <configuration>
|
Chris@0
|
3 <system.webServer>
|
Chris@0
|
4 <!-- Don't show directory listings for URLs which map to a directory. -->
|
Chris@0
|
5 <directoryBrowse enabled="false" />
|
Chris@0
|
6
|
Chris@0
|
7 <!--
|
Chris@0
|
8 Caching configuration was not delegated by default. Some hosters may not
|
Chris@0
|
9 delegate the caching configuration to site owners by default and that
|
Chris@0
|
10 may cause errors when users install. Uncomment this if you want to and
|
Chris@0
|
11 are allowed to enable caching.
|
Chris@0
|
12 -->
|
Chris@0
|
13 <!--
|
Chris@0
|
14 <caching>
|
Chris@0
|
15 <profiles>
|
Chris@0
|
16 <add extension=".php" policy="DisableCache" kernelCachePolicy="DisableCache" />
|
Chris@0
|
17 <add extension=".html" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="14:00:00" />
|
Chris@0
|
18 </profiles>
|
Chris@0
|
19 </caching>
|
Chris@0
|
20 -->
|
Chris@0
|
21
|
Chris@0
|
22 <rewrite>
|
Chris@0
|
23 <rules>
|
Chris@0
|
24 <rule name="Protect files and directories from prying eyes" stopProcessing="true">
|
Chris@0
|
25 <match url="\.(engine|inc|install|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format|composer\.(json|lock))$" />
|
Chris@0
|
26 <action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." />
|
Chris@0
|
27 </rule>
|
Chris@0
|
28
|
Chris@0
|
29 <rule name="Force simple error message for requests for non-existent favicon.ico" stopProcessing="true">
|
Chris@0
|
30 <match url="favicon\.ico" />
|
Chris@0
|
31 <action type="CustomResponse" statusCode="404" subStatusCode="1" statusReason="File Not Found" statusDescription="The requested file favicon.ico was not found" />
|
Chris@0
|
32 <conditions>
|
Chris@0
|
33 <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
|
Chris@0
|
34 </conditions>
|
Chris@0
|
35 </rule>
|
Chris@0
|
36 <!-- If running on a PHP version affected by httpoxy vulnerability
|
Chris@0
|
37 uncomment the following rule to mitigate it's impact. To make this
|
Chris@0
|
38 rule work, you will also need to add HTTP_PROXY to the allowed server
|
Chris@0
|
39 variables manually in IIS. See https://www.drupal.org/node/2783079.
|
Chris@0
|
40 <rule name="Erase HTTP_PROXY" patternSyntax="Wildcard">
|
Chris@0
|
41 <match url="*.*" />
|
Chris@0
|
42 <serverVariables>
|
Chris@0
|
43 <set name="HTTP_PROXY" value="" />
|
Chris@0
|
44 </serverVariables>
|
Chris@0
|
45 <action type="None" />
|
Chris@0
|
46 </rule>
|
Chris@0
|
47 -->
|
Chris@0
|
48 <!-- To redirect all users to access the site WITH the 'www.' prefix,
|
Chris@0
|
49 http://example.com/foo will be redirected to http://www.example.com/foo)
|
Chris@0
|
50 adapt and uncomment the following: -->
|
Chris@0
|
51 <!--
|
Chris@0
|
52 <rule name="Redirect to add www" stopProcessing="true">
|
Chris@0
|
53 <match url="^(.*)$" ignoreCase="false" />
|
Chris@0
|
54 <conditions>
|
Chris@0
|
55 <add input="{HTTP_HOST}" pattern="^example\.com$" />
|
Chris@0
|
56 </conditions>
|
Chris@0
|
57 <action type="Redirect" redirectType="Permanent" url="http://www.example.com/{R:1}" />
|
Chris@0
|
58 </rule>
|
Chris@0
|
59 -->
|
Chris@0
|
60
|
Chris@0
|
61 <!-- To redirect all users to access the site WITHOUT the 'www.' prefix,
|
Chris@0
|
62 http://www.example.com/foo will be redirected to http://example.com/foo)
|
Chris@0
|
63 adapt and uncomment the following: -->
|
Chris@0
|
64 <!--
|
Chris@0
|
65 <rule name="Redirect to remove www" stopProcessing="true">
|
Chris@0
|
66 <match url="^(.*)$" ignoreCase="false" />
|
Chris@0
|
67 <conditions>
|
Chris@0
|
68 <add input="{HTTP_HOST}" pattern="^www\.example\.com$" />
|
Chris@0
|
69 </conditions>
|
Chris@0
|
70 <action type="Redirect" redirectType="Permanent" url="http://example.com/{R:1}" />
|
Chris@0
|
71 </rule>
|
Chris@0
|
72 -->
|
Chris@0
|
73
|
Chris@0
|
74 <!-- Pass all requests not referring directly to files in the filesystem
|
Chris@0
|
75 to index.php. -->
|
Chris@0
|
76 <rule name="Short URLS" stopProcessing="true">
|
Chris@0
|
77 <match url="^(.*)$" ignoreCase="false" />
|
Chris@0
|
78 <conditions>
|
Chris@0
|
79 <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
|
Chris@0
|
80 <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
|
Chris@0
|
81 <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
|
Chris@0
|
82 </conditions>
|
Chris@0
|
83 <action type="Rewrite" url="index.php" />
|
Chris@0
|
84 </rule>
|
Chris@0
|
85 </rules>
|
Chris@0
|
86 </rewrite>
|
Chris@0
|
87
|
Chris@0
|
88 <!-- If running Windows Server 2008 R2 this can be commented out -->
|
Chris@0
|
89 <!-- httpErrors>
|
Chris@0
|
90 <remove statusCode="404" subStatusCode="-1" />
|
Chris@0
|
91 <error statusCode="404" prefixLanguageFilePath="" path="/index.php" responseMode="ExecuteURL" />
|
Chris@0
|
92 </httpErrors -->
|
Chris@0
|
93
|
Chris@0
|
94 <defaultDocument>
|
Chris@0
|
95 <!-- Set the default document -->
|
Chris@0
|
96 <files>
|
Chris@0
|
97 <clear />
|
Chris@0
|
98 <add value="index.php" />
|
Chris@0
|
99 </files>
|
Chris@0
|
100 </defaultDocument>
|
Chris@0
|
101
|
Chris@0
|
102 </system.webServer>
|
Chris@0
|
103 </configuration>
|