Requirements: When publishing a project to a subdirectory of the IIS site, the URL route rewriting module in web.config will report a 500 error because the rule name is the same as the parent directory.
nginx pseudo-static rules
https://www.itsvse.com/thread-7810-1-1.html
IIS URL Rewrite 2.1 enables web administrators to create powerful rules for URLs that are easier for users to remember and search engines to find. By using rule templates, rewriting mappings, . NET provider and other features integrated into IIS Manager, Web administrators can easily set up rules to define programmatic rules for behavior based on HTTP headers, HTTP response or request headers, IIS server variables, and even complex URL rewrites. Additionally, web administrators can perform redirects, send custom responses, or stop HTTP requests based on the logic expressed in the rewrite rule. First, the IIS URL Rewrite module needs to be installed separately, download the URL Rewrite module 2.1 download:The hyperlink login is visible.
Modify the web.config file and add rules for testing, as follows:
If the subdirectory hasRules with the same name, a 500 error will be reported as follows:
500 URL Rewrite Module Error.
Solution 1
Modify the rule name as shown in the following figure:
Solution 2
Remove a single rule or clear all rules.
Remove a single rule, configured as follows:
Clear all rules with the following configuration:
(End)
|