I have an ASP.NET MVC site where the removal of the trailing slash is working as expected except on one single directory - my blog directory.
The blog (Wordpress blog) is in a directory is named 'blog' and the physical folder containin the blog is located at the website root (www.site.com/blog).
I have the below rule configured to remove trailing slashes that seems to be working everywhere except on this directory, but no matter what when I navigate to www.site.com/blog, I'm always recirected to www.site.com/blog/ (extra slash added). Any ideas on how I can get this extra slash to not be added to the end of the URL for this directory? My thought is that it has something to do with the blog directory being both a physical directory as well as the URL, but I'm thoroughly confused on this behavior.
<rule name="Remove trailing slash">
<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>
Thanks for any ideas!
-Jason