regexurliisiis-7requestfiltering

IIS Request Filtering Allow URL


I am using IIS7 request Filtering (WebSite level) with 'Allow unlisted file name extensions' set to un-checked. After this setting when I access my web application say, _http:/machine_name/app1 then it fails. After adding correct file extensions under 'file name extensions' it starts functioning but it later fails when I surf other links inside my application. I found that I need to add URL's under 'Allow URL' but I do have huge number of URL list which need to be added for e.g.: '/app1/prop1', '/app1/prop1/services/', '/app1/prop2/repository'..... and more So, I see a pattern like /app1/* but 'allow URL don't allow any pattern matching. Is there any way to add Regular expression somewhere in IIS so that the matching URL's can be allowed.

Thanks in advance.


Solution

  • I think URLs like '/app1/prop1', '/app1/prop1/services/', '/app1/prop2/repository' don't work with 'Allow unlisted file name extensions' set to false because you didn't allow extensionless requests.

    To allow extensionless requests, add <add fileExtension="." allowed="true" /> to your web.config as below:

      <system.webServer>
        <security>
          <requestFiltering>
            <fileExtensions allowUnlisted="false">
              <add fileExtension="." allowed="true" />
            </fileExtensions>
          </requestFiltering>
        </security>
      </system.webServer>
    

    Please let me know if this helped or the issue still occurs.