The previous day, I wrote a post due to path problems during the development process. Because I have developed something that can definitely be stored in the root directory, so I have not considered transferring it to other sub-directories in the future. Ahnan and lostinet promptly pointed out this defect. Next, I will introduce the improved version 2.0:
1. Change filename to filename. ashx for access to all images and CSS.
2. Write a configuration file containing a comparison table of all images, CSS file names, and paths.
3. Write a custom httphandler and respond to *. ashx. Query the configuration file and route it to the correct file.
4. Because httphandler responds to all static files (these files are cached by IIS), the cache function should be implemented.
Advantages:
Centralized routing. After the file location changes, you can simply change the configuration file.
Disadvantages:
Unable to preview the interface design due to lack of runtime support
Supplement:
This routing handler can also route pages such as aspx and implement more functions with urlrewrite.