Created
January 11, 2018 09:07
-
-
Save l0ll098/922b77975c5109ce9a64540e545c9dd5 to your computer and use it in GitHub Desktop.
Hide the .html extension Azure/IIS websites
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="RemoveDotHtml" enabled="true" stopProcessing="true"> | |
<match url="(.*)\.html" /> | |
<action type="Redirect" url="{R:1}" /> | |
</rule> | |
<rule name="AddDotHtml" enabled="true"> | |
<match url=".*" negate="false" /> | |
<conditions> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> | |
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> | |
<add input="{URL}" pattern="(.*)\.(.*)" negate="true" /> | |
</conditions> | |
<action type="Rewrite" url="{R:0}.html" /> | |
</rule> | |
</rules> | |
</rewrite> | |
</system.webServer> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment