1) Your existing web.config: you declared a rewrite map .. but did not create any rules that will use it. RewriteMap does absolutely nothing at its own expense.
2) You can do this below (it does not use rewriting cards - only the rules, which is great for a small amount of rewriting / forwarding):
This rule will do SINGLE EXACT rewrite (internal redirection) /page to /page.html . The URL in the browser will remain unchanged.
<system.webServer> <rewrite> <rules> <rule name="SpecificRewrite" stopProcessing="true"> <match url="^page$" /> <action type="Rewrite" url="/page.html" /> </rule> </rules> </rewrite> </system.webServer>
This rule No. 2 will do the same as above, but it will perform 301 redirects (permanent redirects), where the URL will be changed in the browser.
<system.webServer> <rewrite> <rules> <rule name="SpecificRedirect" stopProcessing="true"> <match url="^page$" /> <action type="Redirect" url="/page.html" /> </rule> </rules> </rewrite> </system.webServer>
Rule No. 3 will try to execute such correspondence for ANY URL if there is such a file with the extension .html (i.e. for /page it will check if /page.html , and if this happens, then it will be rewritten ):
<system.webServer> <rewrite> <rules> <rule name="DynamicRewrite" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{REQUEST_FILENAME}\.html" matchType="IsFile" /> </conditions> <action type="Rewrite" url="/{R:1}.html" /> </rule> </rules> </rewrite> </system.webServer>
LazyOne Jul 19 2018-11-11T00: 00Z
source share