« Previous Next »

Thread: IIS 7 URL Rewrite Help needed

Last post 05-26-2009 1:41 PM by fiaz110. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 05-24-2009, 6:37 AM

    • fiaz110
    • Not Ranked
    • Joined on 05-24-2009, 6:26 AM
    • Posts 3

    IIS 7 URL Rewrite Help needed

    Hi All,

    I am new to IIS 7. Previously I have done the URL Rewriting using Helicon Tech's ISAPI Rewrite and IONIC ISAPI Rewrite Filter. The url and its rewrite is written below.

    /tree-service/austin/ should be written to /request.asp?city=austin

    If anybody can provide me the complete sample web.config then I will be extremely greateful to you.

    Thanking in advance,
    Fiaz

  • 05-24-2009, 3:31 PM In reply to

    • DanielVL
    • Top 75 Contributor
    • Joined on 10-07-2006, 6:00 PM
    • Redmond, WA, USA
    • Posts 109

    Re: IIS 7 URL Rewrite Help needed

    1. Open IIS Manager

    2. Browse to you web site.

    3. Open the "URL Rewrite" feature.

    4. In the Actions pane, click "Add Rules..."

    5. In the "Add rule(s)" dialog select the template "User friendly URL" and click OK.

    6. In the opened dialog, enter the internal URL that you expect, that is "/request.asp?city=austin"

    7. In the combo box select the public URL that suits you, that would be "/request/austin/"

    8. A small change once you select the combo item, in the URL pattern text box change "^request/([^/]+)/?$" by "^tree-service/([^/]+)/?$"

    9. Click OK and you should be ready to go.

     

    Daniel Vasquez Lopez
    URL Rewrite Engine Developer
  • 05-24-2009, 4:27 PM In reply to

    • fiaz110
    • Not Ranked
    • Joined on 05-24-2009, 6:26 AM
    • Posts 3

    Re: IIS 7 URL Rewrite Help needed

    Hi,

    Thanks alot for your reply. Actually I have windows XP so that's why I can't install IIS7 on my development machine but one of my client has switched his hosting to IIS7. Now previuosly I had done URL Rewriting using Helicon Tech ISAPI Rewrite. Now I have to rewrite the same thing using web.config for IIS7 hosting. If anybody can give me a sample web.config then I will be really greatful.

    /tree-service/cityName/ should be rewritten to /request.asp?city=cityName

    Waiting for response
    Fiaz

  • 05-26-2009, 12:24 PM In reply to

    • DanielVL
    • Top 75 Contributor
    • Joined on 10-07-2006, 6:00 PM
    • Redmond, WA, USA
    • Posts 109

    Re: IIS 7 URL Rewrite Help needed

    You could potentially administrate the site from XP using IIS Manager for XP:

    http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1626

    Here is the web.config :)

    <configuration>
      <system.webServer>
        <rewrite>
          <rules>
            <rule name="TreeService Rule" stopProcessing="true">
              <match url="^tree-service/([^/]+)/?$" />
              <conditions>
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
              </conditions>
              <action type="Rewrite" url="request.asp?city={R:1}" />
            </rule>
          </rules>
        </rewrite>
      </system.webServer>
    </configuration>

    Daniel Vasquez Lopez
    URL Rewrite Engine Developer
  • 05-26-2009, 1:41 PM In reply to

    • fiaz110
    • Not Ranked
    • Joined on 05-24-2009, 6:26 AM
    • Posts 3

    Re: IIS 7 URL Rewrite Help needed

    Thanks alot Daniel. It worked perfectly.

     Regards
    Fiaz

Page 1 of 1 (5 items)
Microsoft Communities