How can i configure IIS so all requests are blocked except those that I allow?
So for example www.mypage.com is reachable and everything else is blocked except all requests starting with wwwroot
Allow:
www.mypage.com*
www.mypage.com/wwwroot/*
There are 2 options to do this
Option 1 - Using Request Filtering.
Downside of this approach is you need to add all the URLs that you want to block. I am not sure if we can add a regular expression here.
Option 2 - Using URL Rewrite (Preferable method)
With this anything other then wwwroot will be blocked. You can double click the Rule under URL-Rewrite and customize accordingly. Also make sure to disable the rule for static files/folders (.js,.css, images)
Reference - http://www.iis.net/learn/extensions/url-rewrite-module/request-blocking-rule-template
Hope this helps.