Map subfolder to root folder RRS feed

  • Question

  • User610302381 posted

    I have a subdomain with its respective folder (hosting provider doesn't allow subdomain without linked subfolder), however code in root folder uses subdomain part of url to determine what to do, in other words, subdomain folder is empty (just web.config?). So subdomain.domain.com should run in the root folder, displaying subdomain.domain.com in the address bar (for SEO purposes).

    I tried to implement using the following and several variations:

                <rewriteMap name="sub">
                    <add key="subdomain.domain.com" value="www.domain.com" />
              <rule name="Rewrite Rule">
                <match url=".*" />
                  <add input="{sub:{HTTP_HOST}}" pattern="(.+)" />
                <action type="Rewrite" url="{C:1}"/>

    But apparently this is completely wrong, is there any way to map subdomain.domain.com into www.domain.com?
    Must be displayed as subdomain.domain.com/* in the address bar, but run like www.domain.com/*.

    Friday, January 20, 2012 8:37 PM


All replies