We have a published .NET Core 3.1 website hosted by IIS. The root folder (containing the DLLs) is: c:\qa\web\
Otherwise we have folders like:
- c:\qa\web\wwwroot\css
- c:\qa\web\wwwroot\js
In IIS we made a virtual directory named "images". The website can be access via http://localhost
We can view individual files without error:
- http://localhost/js/brand.js
- http://localhost/css/main.css
However we get a 404 when trying to view files in the virtual directory:
http://localhost/images/foo.jpg
But if we insert "/wwwroot" in the URL, we see the contents of the virtual directory without issue:
http://localhost/wwwroot/images/foo.jpg
Why do we need "wwwroot/" in the URL? When we run the same website from Visual Studio / IIS Express, we don't need "wwwroot/" in the URL to view /images/foo.jpg
I thought maybe if we set the Virtual Directory alias to "wwwroot/images" it might work, but it doesn't allow for the slash character in the alias.