Skip to content

Instantly share code, notes, and snippets.

@l0ll098
Created January 11, 2018 09:07
Show Gist options
  • Save l0ll098/922b77975c5109ce9a64540e545c9dd5 to your computer and use it in GitHub Desktop.
Save l0ll098/922b77975c5109ce9a64540e545c9dd5 to your computer and use it in GitHub Desktop.
Hide the .html extension Azure/IIS websites
<?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