I used his rule as the rewrite subdomain
<rule name="Rewrite subdomain" stopProcessing="false">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(?!www)(\w+)\.domain\.net$" />
</conditions>
<action type="Rewrite" url="{C:1}/{R:1}" />
</rule>
I used his rule as the redirect subdomain
<rule name="Redirect subdomain" stopProcessing="true">
<match url="(\w+)/(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^domain\.net$" />
</conditions>
<action type="Redirect" url="http://{R:1}.domain.net/{R:2}"redirectType="Permanent" />
</rule>
When url have'nt www, Redirect subdomain work fine
http://domain.net/news => http://news.domain.net
but if url have www, Redirect subdomain does not working
http://www.domain.net/news => http://www.domain.net/news
What should I do?
I apologize from the long post, thanks