Как написать правила перезаписи IIS для блокировки страниц под определенным именем? - PullRequest
0 голосов
/ 26 октября 2019

В модуле перезаписи URL IIS я хочу написать правило, которое блокирует любой запрос, пытающийся получить доступ к файлу в этих папках, и делает его нечувствительным к регистру.

/Messages

или

/Templates

У меня пока что

<rewrite>
  <rules>
    <rule name="Fail bad requests">
      <match url="^/Messages/.*"/>
      <conditions>
      </conditions>
      <action type="AbortRequest" />
    </rule>
    <rule name="SPA Routes" stopProcessing="true">
      <!-- match everything by default -->
      <match url=".*" />
      <conditions logicalGrouping="MatchAll">
        <!-- unless its a file -->
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <!-- or a directory -->
        <!--<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />-->
        <!-- or is under the /api directory -->
        <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
        <!-- list other routes or route prefixes here if you need to handle them server side -->
      </conditions>
      <!-- rewrite it to /index.html -->
      <action type="Rewrite" url="App/index.html" />
    </rule>
  </rules>
</rewrite>

но это не работает. Кто-нибудь знает, что не так?

Спасибо

...