How To Deny Access To File But Allow Server

点点圈 提交于 2020-01-01 06:29:04

问题


I have a web application that has a configuration folder that houses multiple XML files that are configuration settings for multiple "portals" as you will. I need IIS to have access to them so the "portal" loads (sql connection strings, master page paths) but I want to deny any outside access (url browsing). Here's an example below:

http://www.mywebsite/virtualdirectory/configurationdirectory/configfile.xml

I need to restrict access to this file if you're browsing to it but still allow the system access to it so it can parse the "portal" that it's loading.

Any ideas?


回答1:


You could do this with a rewrite rule

You can also do this with a Request Filtering rule




回答2:


If the website doesn't need to serve XML files to the end user then remove it as a MIME type.



来源:https://stackoverflow.com/questions/3935930/how-to-deny-access-to-file-but-allow-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!