Hey guys,

I use a standard web.config file for my projects that are hosted on Windows servers. It takes care of 2 tasks.

1. It redirects the non-www version of the site to the www version.
2. It redirects the index file to the root.

See below:
<?xml version="1.0" encoding="UTF-8"?>
     <modules runAllManagedModulesForAllRequests="true" />
                <rule name="CanonicalHostNameRule1" stopProcessing="true">
                    <match url="index\.asp(?:l)?" />
                            <add input="{HTTP_HOST}" pattern="domain\.com$" />
                        <action type="Redirect" url="http://www.domain.com/" />
                <rule name="CanonicalHostNameRule2" stopProcessing="true">
                    <match url="(.*)" />
                        <add input="{HTTP_HOST}" pattern="^domain\.com$" />
                    <action type="Redirect" url="http://www.domain.com/{R:1}" />
This works great, except for 1 problem. The index redirect is redirecting all sub-directories to the main, index.

For example:
http://www.domain.com/index.asp is redirecting to http://www.domain.com like it should.

But, http://www.domain.com/about/index.asp is also redirecting to http://www.domain.com.

I would like it to redirect to http://www.domain.com/about/

Any help would be greatly appreciated.