I have a number of rewrite rules for a lot of things that I did in IIS7, like removing trailing slashes, canonnical URLs, lowercase lettering, and such. IIS altered my web.config, and everything works fine on the website, like it should. But in the Visual Studio web.config, the opening <rewrite>
statement is underlined in blue, and at the bottom of VS, it says that the element 'system.webServer' has invalid child element 'rewrite'. But this is how IIS made it ... I didn't do this manually. Should I be concerned with this VS error, or should I just leave as be, since it's working how it should work?
Here's an example of my web.config:
<system.webServer>
<rewrite> <-------------------- this is underlined in squiggly blue
<rules>
<rule name="RemoveASPX" enabled="true" stopProcessing="true">
<match url="(.*).aspx" />
<action type="Redirect" url="{R:1}" />
<conditions logicalGrouping="MatchAll">
<add input="{URL}" pattern="(.*)/default.aspx" negate="true" />
<add input="{URL}" pattern="(.*)/admin/*" negate="true" />
<add input="{URL}" pattern="(.*)/desktopmodules/*" negate="true" />
</conditions>
</rule>
There are about 5 or 6 other rules, then a closing </system.webServer>
at the end.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…