Posted on 24/02/2017 16:19:07
Hi Jan
Depends. In the forums her i.e., you can upload from the frontend. I.e. a cshtml file - making a security issue. So, that is why It should be thought through when editing the web.config.
You also simply move the files to i.e. /CustomModules/ or another subfolder in the root, or add another section that have another location path attribute set Files/MyCustomRazor and allow Razor only in that subfolder.
<location path="Files" allowOverride="false">
<system.webServer>
<staticContent>
<remove fileExtension=".cshtml" />
<mimeMap fileExtension=".cshtml" mimeType="text/plain" />
<remove fileExtension=".vbhtml" />
<mimeMap fileExtension=".vbhtml" mimeType="text/plain" />
<remove fileExtension=".aspx" />
<mimeMap fileExtension=".aspx" mimeType="text/plain" />
</staticContent>
<handlers>
<clear />
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>