After the ASP is published, some files are not accessed directly through URL for security purposes.
There are usually 2 ways of doing this:
1. Set the file directory in the default hidden directory such as App_code or App_Data
2. Add the file directory to the hidden segment of the request filter so that the file cannot be accessed directly through the URL
In IIS configuration is request filtering---> Add hidden segments, the configuration in IIS is actually the configuration Web. config file
can also be directly on the web. Config file inside configuration, configuration/system.webserver/security/requestfiltering/hiddensegments node
Add a directory that does not allow direct URL access
<system.webServer> <staticContent> <remove fileextension=". Woff"/> <mimemap fileextension=". Woff"Mimetype="Font/x-font-woff"/> <remove fileextension=". WOFF2"/> <mimemap fileextension=". WOFF2"Mimetype="Font/x-font-woff"/> </staticContent> <validation validateintegratedmodeconfiguration="true"/> <modules></modules> <security> <requestFiltering> <!--maxallowedcontent Length=100mb--> <requestlimits maxallowedcontentlength="104857600"></requestLimits> "File"/> <!--file folder cannot be downloaded directly hidden segments--The ASP. NET configuration does not allow URLs to access resources under the directory