I created a friendly URL to a web application on Sharepoint 2013, something like www.contoso.com/site/index. Is it possible to setup sharepoint so that all attempts to access its child URls, e.g. copying and pasting "www.contoso.com/site/index/whatever/something" in the browser, will prompt sharepoint to automatically redirect to www.contoso.com/site/index?
One of the options is to use IIS Rewrite Rules. You need to download and install it first.
Then you can create Redirect rule using regular expressions: https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module#creating-a-redirect-rule