SEO, IIS 7 and web.config in subfolder issue
Posted
by
tesicg
on Pro Webmasters
See other posts from Pro Webmasters
or by tesicg
Published on 2013-10-17T10:24:58Z
Indexed on
2013/10/18
4:14 UTC
Read the original article
Hit count: 226
seo
We have ASP.NET application that has sub-folder with .aspx pages and separate web.config file in it. The .aspx pages in that sub-folder behave as separate site. In the web.config file at application level, I set the rule that removing trailing slashes:
<rewrite>
<rules>
<rule name="RemoveTrailingSlashRule1" stopProcessing="true">
<match url="(.*)/$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="{R:1}" />
</rule>
</rules>
</rewrite>
I expect this rule will propagate downward to sub-folder as well.
To access the site in sub-folder we should type:
http://concert.local/elki/
and get it without trailing slash as:
http://concert.local/elki
But, the trailing slash remains.
The web.config file in sub-folder looks as following:
<configuration>
<system.webServer>
<defaultDocument>
<files>
<add value="Sections.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
© Pro Webmasters or respective owner