« Previous Next »

Thread: Static URL Rewrite

Last post 07-08-2009 12:22 AM by ruslany. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 07-02-2009, 4:21 PM

    Static URL Rewrite

    I have a single site (Default Web Site), using IIS 7.0, have URL Rewrite installed, and multiple domains point to this same single site.

     

    When a user browses to URL: orders.widgets.com I would like to have them either redirected or rewritten (preferred) to the URL: orders.widgets.com/Login.asp?pos=widget

    Here is another one

    From URL: products.company.com

    To URL: products.company.com/Login.asp?pos=compny

     

    I have tried using the Rewrite Maps but that hasn't worked because it seems to be looking at URL past the domain Example: products.company.com

     

    Thanks in Advance for your help.

  • 07-02-2009, 6:09 PM In reply to

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

    Re: Static URL Rewrite

    You can access the domain part of the URL y using the condition that checks {HTTP_HOST}, e.g:

     <rule name="rule">
                        <match url="^$" />
                        <conditions>
                            <add input="{HTTP_HOST}" pattern="^\w+\.(\w+)\.com$" />
                        </conditions>
                        <action type="Rewrite" url="Login.asp?pos={C:1}" appendQueryString="false" />
       </rule>

    http://ruslany.net
  • 07-03-2009, 4:17 PM In reply to

    Re: Static URL Rewrite

     I tried your example but the problem is the value of {C:1} is not any where in the URL. I think what I am looking for is to have a rewrite map.

    orders.widgets.com = orders.widgets.com/login.asp?pos=123

    products.company.com = products.company.com/login.asp?pos=abc

  • 07-08-2009, 12:22 AM In reply to

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

    Re: Static URL Rewrite

    Yes, if the value for the pos parameter cannot be extracted from the incoming URL, then you have to use rewrite maps.

    http://ruslany.net
Page 1 of 1 (4 items)
Microsoft Communities