locked
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:

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

    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/*.
    Thanks!

    Friday, January 20, 2012 8:37 PM

Answers

All replies