URL rewrite invalid child element under system.webServer in web.config


URL <rewrite> invalid child element in <system.webServer>

        <rule name=Main Rule stopProcessing=true>
        <match url=^((?!api).)*$ />
        <conditions logicalGrouping=MatchAll>
        <add input={REQUEST_FILENAME} matchType=IsFile negate=true />
        <add input={REQUEST_FILENAME} matchType=IsDirectory negate=true />
       <action type=Rewrite url=/ />

Production IIS server throw an error <rewrite> invalid child element in <system.webServer> .

Install URL Rewrite module tool on Server.

Read more about

More About URL ReWrite

Download Tool from
Download the x86 version of the URL Rewrite module
Download the x64 version of the URL Rewrite module

ReWrite will work on II7 or higher