IIS is not honoring the trailing slash in a redirect

httpiisredirect

I've configured a redirect to point from anything in the root directory to /racktables/. When I actually go to http://host/, however, I am redirected to http://host/racktables, which, of course, redirects back to http://host/racktables ad infinitum.

Entry from web.config: <httpRedirect enabled="true" destination="/racktables/" exactDestination="true" childOnly="true" />

Is it possible to get IIS to honor this redirect exactly, or will I have to create a redirect in the default document at the root of the site? It seems like that would be a fairly significant oversight on Microsoft's part.

Best Answer

If you take a look at the URL Rewrite Module it has some default rules to enforce or change the URL. Two of them that I know about are converting the entire URL to lowercase and another appends a trailing slash to all non-file requests. They are there primarily for SEO purposes but combined with what you have might "replace" or compliment your current setup.

Related Topic