I am using the below redirect rule so as to remove the trailing slash in the URL. The trailing slash is removed but the redirect is happening to HTTP URL and not to HTTPS URL. Can you please help to update the below redirect rule so as to redirect to the HTTPS URL?
<rule name="Remove 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>
CodePudding user response:
<action type="Redirect" redirectType="Permanent" url="https://{SERVER_NAME}/{R:1}" />