« Previous Next »

Thread: Mask a folder using URL rewrite

Last post 06-25-2009 6:58 AM by mcdotnet. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 06-24-2009, 7:03 AM

    • mcdotnet
    • Not Ranked
    • Joined on 09-10-2008, 8:41 AM
    • Posts 8

    Mask a folder using URL rewrite

    Hi,

    I am not sure if what I am asking is possible?

    In a shared hosting enviroment with a static IP I have two websites located in two folders within the root directory.

    I wish to map the two domains to their corresponding folders so when someone types in http://www.domain1.com they access the content at http://www.domain1.com/website1/ but the browser shows the url as http://www.domain1.com therefore hiding the fact that the website is in a subfolder.

    Below is the rule I was going to use to point the two domains to their relevant folders.

     As you can see below I am using a permanent redirect which I think may have a negative impact on the SEO. Is there another way of doing this without using a 301 redirect?. 

    I wish the likes of Google to see my website address as http://www.domain1.com as opposed to http://www.domain1.com/website1/ (if possible).

    <rule name="Website1" stopProcessing="true">
    <
    match url="^(.*)$" />
    <
    action type="Redirect" url="http://www.Domain1.com/Website1/{PATH_INFO}" redirectType="Permanent" />
    <
    conditions logicalGrouping="MatchAny">
    <
    add input="{HTTP_HOST}" pattern="^www.Domain1.com$" />
    </
    conditions>
    </
    rule>

    <rule name="Website2" stopProcessing="true">
    <
    match url="^(.*)$" />
    <
    action type="Redirect" url="http://www.Domain2.com/Website2/{PATH_INFO}" redirectType="Permanent" />
    <
    conditions logicalGrouping="MatchAny">
    <add input="{HTTP_HOST}" pattern="^www.Domain2.com$" />
    </
    conditions>
    </
    rule>

    Thanks
  • 06-24-2009, 1:25 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 3:38 PM
    • Redmond, WA
    • Posts 660

    Re: Mask a folder using URL rewrite

     Look at this article: http://learn.iis.net/page.aspx/468/using-global-and-distributed-rewrite-rules/. It may give you an idea on how to do create rules to rewrite subdomains.

    http://ruslany.net
  • 06-25-2009, 6:58 AM In reply to

    • mcdotnet
    • Not Ranked
    • Joined on 09-10-2008, 8:41 AM
    • Posts 8

    Re: Mask a folder using URL rewrite

    Fantastic! This worked a treat! Thanks!

Page 1 of 1 (3 items)
Microsoft Communities