Skip to content

Instantly share code, notes, and snippets.

@Swimburger
Created October 8, 2018 00:02
Show Gist options
  • Save Swimburger/5f2a65cc74cd802f31f56039f87d9d3a to your computer and use it in GitHub Desktop.
Save Swimburger/5f2a65cc74cd802f31f56039f87d9d3a to your computer and use it in GitHub Desktop.
Add trailing slash to URL redirects IIS web.config
<rule name="Add trailing slash" stopProcessing="true">
<match url="(.*[^/])$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="{R:1}/" />
</rule>
@mtyide
Copy link

mtyide commented Dec 13, 2022

What if you want to FORCE redirect to HTTPS?

@Swimburger
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment