IIS change location of web.config file

Lieber, Adam 1 Reputation point
2021-08-25T16:25:19.533+00:00

I have a web server with a virtual directory to D:\test hosted as a critical web application.
When a user navigates to \testserver\test in a web browser it pulls up the entire file contents of D:\Test.
The web.config file is located in D:\Test is there anyway to move the config file to another directory?
I experienced a problem yesterday where the web.config file was missing from the server and thus i had to rebuild it from scratch. I am unsure what happened to the file as it was not recorded via 4663 file delete events

D:\test is also setup as a file share for users to upload files to this location however they should not have deleted the file.

Please advise how I can redirect the location of the web.config so that it cannot be deleted.

Thanks,

Internet Information Services
{count} votes