Q:

404 File or directory not found with query subpath

IIS 10 is throwing the error 
404 File or directory not found

Only when I try to access the url with subfolder path like this:
http://myserveraddress.com/object/181

So it works without the subfolder. The subfolder path is used by Angular to query a rest interface so there is no physical folder path behind it, just used for querying behind the schene.
This actually works when running on localhost but not on the server.
Is it possible to configure IIS such that it allows any url path even though the physical folder path does not exist?

A:

The solution was to add this to the Angular client web.config file 
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="AngularJS Routes" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Rewrite" url="/" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

More detail can be found here Get Angular2 routing working on IIS 7.5

