URL Rewriting

Last post 09-18-2008 3:22 PM by Bruce L. 4 replies.

Sort Posts:

  • URL Rewriting

    09-17-2008, 5:04 AM
    • Member
      12 point Member
    • Nabeel5
    • Member since 02-06-2008, 12:15 PM
    • Posts 21

     

    I have used the Intelligencia.UrlRewriter.dll for URl Rewriting in my asp.net application. and added rules in the web.config files like

    <rewriter>

    <rewrite url="~/green(.*)" to="~/greenpage.aspx"/>

    <rewrite url="~/yellow(.*)" to="~/yellowpage.aspx"/>

    </rewriter>

    when i run it in Visual studio it works fine. like http//localhost:1288/myproject/green

     but when i run it through localhost/myproject/myproject/green

    it shows page cann't be displayed.

    Why is this happening with localhost

     

     

  • Re: URL Rewriting

    09-17-2008, 5:37 AM
    • Participant
      1,266 point Participant
    • Mojtaabaa
    • Member since 04-29-2008, 6:54 AM
    • ایران
    • Posts 245
  • Re: URL Rewriting

    09-17-2008, 7:10 PM
    • Star
      11,400 point Star
    • Bruce L
    • Member since 02-08-2007, 6:53 PM
    • Posts 1,921

    Did you configure wildcard mapping on the live server?

    Your localhost is probably vs.net dev web server which has built in wildcard mapping.

    Bruce
    DiscountASP.NET - ASP.NET Hosting Experts
    Voted 2009 "Best ASP.NET Hosting" by asp.netPRO Magazine
    Win2008/IIS7.0, ASP.NET 2.0/3.5 SP1, MVC, AJAX, Silverlight, SQL 2008/2005
  • Re: URL Rewriting

    09-18-2008, 6:48 AM
    • Member
      12 point Member
    • Nabeel5
    • Member since 02-06-2008, 12:15 PM
    • Posts 21

    I used the thrid party dll. which i mentioned above.

    So i didn't configure any wildcard mapping ?

    would you please explain a little more.

  • Re: URL Rewriting

    09-18-2008, 3:22 PM
    Answer
    • Star
      11,400 point Star
    • Bruce L
    • Member since 02-08-2007, 6:53 PM
    • Posts 1,921

    OK.. basically the URLrewrite you use is a .NET component.  IIS (unlike development server) uses different ISAPI to handle different file type, eg. *.asp is handled by asp ISAPI or *.pl is handled by either Perl CGI or ISAPI.

    Since you are trying to rewrite a extension less path, without wildcard mapping, IIS will not even pass the request to ASP.NET and thus never reaches your rewrite component.

    I hope this is clear.

    Bruce
    DiscountASP.NET - ASP.NET Hosting Experts
    Voted 2009 "Best ASP.NET Hosting" by asp.netPRO Magazine
    Win2008/IIS7.0, ASP.NET 2.0/3.5 SP1, MVC, AJAX, Silverlight, SQL 2008/2005
Page 1 of 1 (5 items)