|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<configuration> |
| 3 | + <system.webServer> |
| 4 | + |
| 5 | + <!-- Default Document --> |
| 6 | + <defaultDocument> |
| 7 | + <files> |
| 8 | + <clear /> |
| 9 | + <add value="index.php" /> |
| 10 | + </files> |
| 11 | + </defaultDocument> |
| 12 | + |
| 13 | + <!-- HTTP Headers --> |
| 14 | + <httpHeaders> |
| 15 | + <!-- Security Headers --> |
| 16 | + <add name="X-Frame-Options" value="SAMEORIGIN" /> |
| 17 | + |
| 18 | + <!-- CORS Headers --> |
| 19 | + <add name="Access-Control-Allow-Origin" value="*" /> |
| 20 | + <add name="Access-Control-Allow-Methods" value="GET,PUT,POST,DELETE" /> |
| 21 | + <add name="Access-Control-Allow-Headers" value="Content-Type, Authorization" /> |
| 22 | + </httpHeaders> |
| 23 | + |
| 24 | + <!-- Static Content --> |
| 25 | + <staticContent> |
| 26 | + <!-- Cache Control for static files --> |
| 27 | + <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" /> |
| 28 | + </staticContent> |
| 29 | + |
| 30 | + <!-- URL Compression --> |
| 31 | + <urlCompression doStaticCompression="true" doDynamicCompression="true" /> |
| 32 | + |
| 33 | + <!-- HTTP Compression --> |
| 34 | + <httpCompression> |
| 35 | + <dynamicTypes> |
| 36 | + <add mimeType="application/javascript" enabled="true" /> |
| 37 | + <add mimeType="application/json" enabled="true" /> |
| 38 | + <add mimeType="application/rss+xml" enabled="true" /> |
| 39 | + <add mimeType="application/xml" enabled="true" /> |
| 40 | + <add mimeType="text/css" enabled="true" /> |
| 41 | + <add mimeType="text/html" enabled="true" /> |
| 42 | + <add mimeType="text/javascript" enabled="true" /> |
| 43 | + <add mimeType="text/plain" enabled="true" /> |
| 44 | + <add mimeType="text/xml" enabled="true" /> |
| 45 | + </dynamicTypes> |
| 46 | + <staticTypes> |
| 47 | + <add mimeType="image/svg+xml" enabled="true" /> |
| 48 | + <add mimeType="application/font-woff" enabled="true" /> |
| 49 | + <add mimeType="application/font-woff2" enabled="true" /> |
| 50 | + </staticTypes> |
| 51 | + </httpCompression> |
| 52 | + |
| 53 | + <!-- Custom Errors --> |
| 54 | + <httpErrors> |
| 55 | + <remove statusCode="404" subStatusCode="-1" /> |
| 56 | + <error statusCode="404" path="/index.php?action=404" responseMode="ExecuteURL" /> |
| 57 | + </httpErrors> |
| 58 | + |
| 59 | + <!-- URL Rewrite Rules --> |
| 60 | + <rewrite> |
| 61 | + <rules> |
| 62 | + |
| 63 | + <!-- General pages --> |
| 64 | + <rule name="Add FAQ" stopProcessing="true"> |
| 65 | + <match url="^add-faq\.html$" /> |
| 66 | + <action type="Rewrite" url="index.php?action=add" appendQueryString="true" /> |
| 67 | + </rule> |
| 68 | + |
| 69 | + <rule name="Add Question" stopProcessing="true"> |
| 70 | + <match url="^add-question\.html$" /> |
| 71 | + <action type="Rewrite" url="index.php?action=ask" appendQueryString="true" /> |
| 72 | + </rule> |
| 73 | + |
| 74 | + <rule name="Show Categories" stopProcessing="true"> |
| 75 | + <match url="^show-categories\.html$" /> |
| 76 | + <action type="Rewrite" url="index.php?action=show" appendQueryString="true" /> |
| 77 | + </rule> |
| 78 | + |
| 79 | + <rule name="General Actions" stopProcessing="true"> |
| 80 | + <match url="^(search|open-questions|contact|glossary|overview|login|privacy)\.html$" /> |
| 81 | + <action type="Rewrite" url="index.php?action={R:1}" appendQueryString="true" /> |
| 82 | + </rule> |
| 83 | + |
| 84 | + <rule name="Login Alternative" stopProcessing="true"> |
| 85 | + <match url="^(login)$" /> |
| 86 | + <action type="Rewrite" url="index.php?action=login" appendQueryString="true" /> |
| 87 | + </rule> |
| 88 | + |
| 89 | + <!-- Start page --> |
| 90 | + <rule name="Index" stopProcessing="true"> |
| 91 | + <match url="^index\.html$" /> |
| 92 | + <action type="Rewrite" url="index.php" /> |
| 93 | + </rule> |
| 94 | + |
| 95 | + <!-- Solution ID page --> |
| 96 | + <rule name="Solution ID" stopProcessing="true"> |
| 97 | + <match url="^solution_id_([0-9]+)\.html$" /> |
| 98 | + <action type="Rewrite" url="index.php?solution_id={R:1}" appendQueryString="true" /> |
| 99 | + </rule> |
| 100 | + |
| 101 | + <!-- Bookmarks page --> |
| 102 | + <rule name="Bookmarks" stopProcessing="true"> |
| 103 | + <match url="^bookmarks\.html$" /> |
| 104 | + <action type="Rewrite" url="index.php?action=bookmarks" appendQueryString="true" /> |
| 105 | + </rule> |
| 106 | + |
| 107 | + <!-- FAQ record page --> |
| 108 | + <rule name="FAQ Content" stopProcessing="true"> |
| 109 | + <match url="^content/([0-9]+)/([0-9]+)/([a-z\-_]+)/(.+)\.htm(l?)$" /> |
| 110 | + <action type="Rewrite" url="index.php?action=faq&cat={R:1}&id={R:2}&artlang={R:3}" appendQueryString="true" /> |
| 111 | + </rule> |
| 112 | + |
| 113 | + <!-- Category page with page count --> |
| 114 | + <rule name="Category with Page" stopProcessing="true"> |
| 115 | + <match url="^category/([0-9]+)/([0-9]+)/(.+)\.htm(l?)$" /> |
| 116 | + <action type="Rewrite" url="index.php?action=show&cat={R:1}&seite={R:2}" appendQueryString="true" /> |
| 117 | + </rule> |
| 118 | + |
| 119 | + <!-- Category page --> |
| 120 | + <rule name="Category" stopProcessing="true"> |
| 121 | + <match url="^category/([0-9]+)/(.+)\.htm(l?)$" /> |
| 122 | + <action type="Rewrite" url="index.php?action=show&cat={R:1}" appendQueryString="true" /> |
| 123 | + </rule> |
| 124 | + |
| 125 | + <!-- News page --> |
| 126 | + <rule name="News" stopProcessing="true"> |
| 127 | + <match url="^news/([0-9]+)/([a-z\-_]+)/(.+)\.htm(l?)$" /> |
| 128 | + <action type="Rewrite" url="index.php?action=news&newsid={R:1}&newslang={R:2}" appendQueryString="true" /> |
| 129 | + </rule> |
| 130 | + |
| 131 | + <!-- Sitemap --> |
| 132 | + <rule name="Sitemap" stopProcessing="true"> |
| 133 | + <match url="^sitemap/([^\/]+)/([a-z\-_]+)\.htm(l?)$" /> |
| 134 | + <action type="Rewrite" url="index.php?action=sitemap&letter={R:1}&lang={R:2}" appendQueryString="true" /> |
| 135 | + </rule> |
| 136 | + |
| 137 | + <!-- Google sitemap --> |
| 138 | + <rule name="XML Sitemap" stopProcessing="true"> |
| 139 | + <match url="^sitemap\.xml$" /> |
| 140 | + <action type="Rewrite" url="sitemap.xml.php" /> |
| 141 | + </rule> |
| 142 | + |
| 143 | + <rule name="Gzipped Sitemap 1" stopProcessing="true"> |
| 144 | + <match url="^sitemap\.gz$" /> |
| 145 | + <action type="Rewrite" url="sitemap.xml.php?gz=1" /> |
| 146 | + </rule> |
| 147 | + |
| 148 | + <rule name="Gzipped Sitemap 2" stopProcessing="true"> |
| 149 | + <match url="^sitemap\.xml\.gz$" /> |
| 150 | + <action type="Rewrite" url="sitemap.xml.php?gz=1" /> |
| 151 | + </rule> |
| 152 | + |
| 153 | + <!-- Tags page with page count --> |
| 154 | + <rule name="Tags with Page" stopProcessing="true"> |
| 155 | + <match url="^tags/([0-9]+)/([0-9]+)/(.+)\.htm(l?)$" /> |
| 156 | + <action type="Rewrite" url="index.php?action=search&tagging_id={R:1}&seite={R:2}" appendQueryString="true" /> |
| 157 | + </rule> |
| 158 | + |
| 159 | + <!-- Tags page --> |
| 160 | + <rule name="Tags" stopProcessing="true"> |
| 161 | + <match url="^tags/([0-9]+)/([^\/]+)\.htm(l?)$" /> |
| 162 | + <action type="Rewrite" url="index.php?action=search&tagging_id={R:1}" appendQueryString="true" /> |
| 163 | + </rule> |
| 164 | + |
| 165 | + <!-- Authentication services --> |
| 166 | + <rule name="WebAuthn Services" stopProcessing="true"> |
| 167 | + <match url="^services/webauthn(.*)" /> |
| 168 | + <action type="Rewrite" url="services/webauthn/index.php" appendQueryString="true" /> |
| 169 | + </rule> |
| 170 | + |
| 171 | + <!-- User pages --> |
| 172 | + <rule name="User Pages" stopProcessing="true"> |
| 173 | + <match url="^user/(ucp|bookmarks|request-removal|logout|register)$" /> |
| 174 | + <action type="Rewrite" url="index.php?action={R:1}" appendQueryString="true" /> |
| 175 | + </rule> |
| 176 | + |
| 177 | + <!-- Setup and update pages --> |
| 178 | + <rule name="Setup" stopProcessing="true"> |
| 179 | + <match url="^setup/(.*)" /> |
| 180 | + <action type="Rewrite" url="setup/index.php" appendQueryString="true" /> |
| 181 | + </rule> |
| 182 | + |
| 183 | + <rule name="Update" stopProcessing="true"> |
| 184 | + <match url="^update/(.*)" /> |
| 185 | + <action type="Rewrite" url="update/index.php" appendQueryString="true" /> |
| 186 | + </rule> |
| 187 | + |
| 188 | + <!-- Administration API --> |
| 189 | + <rule name="Admin API" stopProcessing="true"> |
| 190 | + <match url="^admin/api/(.*)" /> |
| 191 | + <action type="Rewrite" url="admin/api/index.php" appendQueryString="true" /> |
| 192 | + </rule> |
| 193 | + |
| 194 | + <!-- Private APIs --> |
| 195 | + <rule name="Private APIs" stopProcessing="true"> |
| 196 | + <match url="^api/(autocomplete|bookmark/delete|bookmark/create|user/data/update|user/password/update|user/request-removal|user/remove-twofactor|contact|voting|register|captcha|share|comment/create|faq/create|question/create|webauthn/prepare|webauthn/register|webauthn/prepare-login|webauthn/login)$" /> |
| 197 | + <action type="Rewrite" url="api/index.php" appendQueryString="true" /> |
| 198 | + </rule> |
| 199 | + |
| 200 | + <!-- Setup APIs --> |
| 201 | + <rule name="Setup APIs" stopProcessing="true"> |
| 202 | + <match url="^api/setup/(check|backup|update-database)$" /> |
| 203 | + <action type="Rewrite" url="api/index.php" appendQueryString="true" /> |
| 204 | + </rule> |
| 205 | + |
| 206 | + <!-- REST API v3.0 --> |
| 207 | + <rule name="REST API v3" stopProcessing="true"> |
| 208 | + <match url="^api/v3\.0/(.*)" /> |
| 209 | + <action type="Rewrite" url="api/index.php" appendQueryString="true" /> |
| 210 | + </rule> |
| 211 | + |
| 212 | + </rules> |
| 213 | + </rewrite> |
| 214 | + |
| 215 | + </system.webServer> |
| 216 | +</configuration> |
0 commit comments