WordPress in both root and subfolder (Windows Server IIS) with pretty permalink (/%postname%/) in both[Solved !!!]
Web.config in Main Root Folder as you want.
//Code—–
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="MainWordpressFolder" patternSyntax="Wildcard">
<match url="*"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
</conditions>
<action type="Rewrite" url="index.php"/>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
//Important point to follow in above code
#Add <clear /> after <rules> started…
#<rule name=”MainWordpressFolder” will be unique in all web.config(s) of your hosting.
Web.config in Sub Folder as you want.
//Code—–
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="SubWordpressFolder" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(www.)?youranotherdomain.com" />
<add input="{PATH_INFO}" pattern="^/" negate="true" />
</conditions>
<action type="Rewrite" url="\your\sub\domain\directory\path\{R:0}" />
</rule>
<rule name="SubWordpressFolder-wp" patternSyntax="Wildcard">
<match url="*"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
</conditions>
<action type="Rewrite" url="index.php"/>
</rule></rules>
</rewrite>
</system.webServer>
</configuration>
//Important point to follow in above code
#Add <clear /> after <rules> started…
#First <rule> needed to be defined carefully as described above.
#Second <rule> will be generated from wordpress admin (on permalink change from settings) after generation of above rule, rename the rule name to any-unique-name-of-your-choice
Enjoy ??