OIS Site Forum

Forum and Support Site
Welcome to OIS Site Forum Sign in | Join | Help
in
Home Forums

Rewriting URL with ASP.NET

Last post 10-30-2006, 9:03 PM by admin. 0 replies.
Sort Posts: Previous Next
  •  10-30-2006, 9:03 PM 18

    Rewriting URL with ASP.NET

    URL Rewrite is a method of cleaning up your URLs.  For example: if you have http://site.com/orders.aspx?order_number=1234, you could use URL Rewriting to make it appear as http://site.com/orders/1234.
     
    You can view the article and download binary and source from http://www.codeproject.com/aspnet/URLRewriter.asp
     
    This control uses Regex to create rules which allows for a lot of flexibility.  The rule for the above translation would look something like this...
     
        <rule>
            <url>/orders/(.*)</url>
            <rewrite>/order_number.aspx?order_number=$1</rewrite>
        </rule>
     
    The rules are setup in your web.config.
     
    To make this work with non-aspx page (.html, .php, .jpg, etc) you will need to make changes to IIS (described in the codeproject article).
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems