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