In your allow-all
directory, you can create a web.config file with the following configuration:
<configuration> <system.webServer> <security> <requestFiltering> <fileExtensions> <remove fileExtension=".cs" /> </fileExtensions> </requestFiltering> </security> <staticContent> <mimeMap fileExtension=".cs" mimeType="text/plain" /> </staticContent> </system.webServer> </configuration>
This configuration removes the .cs
extension from query filtering. In addition, in order for IIS to properly serve content, it needs a MIME type, so the .cs
extension is added as / plain text.
These changes also apply to all allow-all
child directories. This configuration works with the integrated application pool. The classic may require additional changes, as there are HTTP handlers that explicitly forbid .cs as well.
source share