ASP.NET Add forward slash to the end of url automatically

Code:
<rewrite>
	<rules>
		<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>
</rewrite>

Stolen from the IIS website but I can't remember where right now.

edit: here
 
Last edited:
thanks pho.
not sure if that is going to work with urlrewriting.net because i dont think it handles the condition part.
 
Back
Top Bottom