URL Rewrite in sub domain

Discussion in 'General troubleshooting' started by Javier Moreno, Nov 12, 2015.

  1. I am having problems setting up url rewrite rules in a subdomain. Let me explain:

    1. I have a domain name www.paginatest.com. In the root web.config I have a rewriting rule

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

    This works fine. Every fo.paginatest.com points to /sitios/fo

    2. Every subdomain is an isolate application in /sitios folder. Then /sitios/fo is an application. In its root folder I have a web.config with rewriting rules such as:

    <rule name="anytopic" stopProcessing="true">
    <match url="^topics" />
    <action type="Rewrite" url="/pages/topics.aspx" />
    </rule>

    I expect than fo.paginatest.com/topics points to /sitios/fo/pages/topics.aspx but this does not work. Server says: Not such folder (topics) in server.

    Any idea?

    Thanks in advance and apologizes for my bad English
     
  2. I think you have to specify the full URL: /sitios/fo/pages/topics.aspx
     

Share This Page