iis distributed rule in side folder not work

Discussion in 'DNS/Domain names' started by Basel2010, May 6, 2012.

  1. hi
    i want to rewrite subdomain to subfolder in my domain

    i worked as this artical

    http://learn.iis.net/page.aspx/468/using-global-and-distributed-rewrite-rules/

    it work good with me

    but the problem in the distributed rule not work

    ex:

    i have subdomain name : en

    my domain is: example.com

    inside example.com create folder name: en

    in side forder en add 2 items called :default.aspx and article.aspx

    when call : en.example.com ===> go to example.com/en/ correctly

    when call en.example.com/Default.aspx ===> go to example.com/en/Default.aspx correctly

    but when call en.example.com/Default ==> HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    i add 2 web.config first one global in example.com

    i write rule as

    <rule name="Subdomain mapping">
    <match url="(.*)" />
    <conditions>
    <add input="{HTTP_HOST}" pattern="^(?!www\.)(\w+)\.\w+\.\w+$/>
    </conditions>
    <action type="Rewrite" url="{C:1}/{R:1}" />
    </rule>

    second one distributed rule in en folder

    i write rule as

    <rule name="SubDomainDefault">
    <match url="^Default*([._0-9a-z-]+)" />
    <action type="Rewrite" url="Default.aspx" />
    </rule>

    i think the distributed rule not work

    what is the wrong in my rules

    thank you very much
     

Share This Page