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


    it work good with me

    but the problem in the distributed rule not work


    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="(.*)" />
    <add input="{HTTP_HOST}" pattern="^(?!www\.)(\w+)\.\w+\.\w+$/>
    <action type="Rewrite" url="{C:1}/{R:1}" />

    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" />

    i think the distributed rule not work

    what is the wrong in my rules

    thank you very much

Share This Page