URL Rewriting Problem when deployed as root website

Last post 06-30-2009 5:50 AM by mihir.mone. 5 replies.

Sort Posts:

  • URL Rewriting Problem when deployed as root website

    06-18-2009, 6:33 AM

    Hello,

     I have an application that has URL rewritting module used in it. When i configure the application as a virtual directory the application works as expected but as soon as i configure it as a website in IIS the URL rewriting starts throwing error.

     My rule looks something like this:

    <rule source="Menu/(\w+)" destination="Menu\.aspx?category=$2"/> 

    Thanks in advance.

    HimRaval
  • Re: URL Rewriting Problem when deployed as root website

    06-18-2009, 8:00 AM
    • All-Star
      36,981 point All-Star
    • rtpHarry
    • Member since 10-01-2006, 8:51 AM
    • Lincoln, England
    • Posts 5,977

     Is it a 404 error?

    You might have to setup wildcard mapping on IIS?

  • Re: URL Rewriting Problem when deployed as root website

    06-18-2009, 8:04 AM
    Answer
    • Star
      12,663 point Star
    • docluv
    • Member since 06-29-2002, 11:16 PM
    • Willow Spring NC
    • Posts 2,004
    • TrustedFriends-MVPs

    I think Harry is right. When you are using the web.dev server all requests are routed through the asp.net engine. This is not the case in IIS, you have to explicitly map each extension type to the correct filter or setup wildcard mapping, where all requests are routed through IIS. I wrote a Blog a while back on how to do this:

    http://professionalaspnet.com/archive/2007/07/27/Configure-IIS-for-Wildcard-Extensions-in-ASP.NET.aspx

  • Re: URL Rewriting Problem when deployed as root website

    06-18-2009, 12:38 PM
    Answer
    • All-Star
      36,981 point All-Star
    • rtpHarry
    • Member since 10-01-2006, 8:51 AM
    • Lincoln, England
    • Posts 5,977

     heh, I have had your blog open in all day today Christ for a bit of on again off again reading while I was coding!

     

    I was in a bit of a rush earlier but the two links I usually give out are (got them tagged in my delicious):

  • Re: URL Rewriting Problem when deployed as root website

    06-27-2009, 2:08 AM

    Hello,

    Thanks for the link its very informative. Sorry for responding so late.

    But still i couldn't get to cause that why would the code not work if its a website in root and works fine if its a virtual directory. Well I had the  wildcard mapping in IIS done for both the cases.

    What is the internal structure thats making the difference in the implementation.

     

    HimRaval
  • Re: URL Rewriting Problem when deployed as root website

    06-30-2009, 5:50 AM
    • Member
      258 point Member
    • mihir.mone
    • Member since 05-20-2008, 12:59 AM
    • Mumbai, India
    • Posts 79

    Hey,

    If you are not getting 404 error, then certainly you need to look into the code.

    May be 'Url segment count is wrong', this is common coding issue regarding Url Rewriting.

    It occurs mostly after deployment, it is caused by Url string.

    Hope this will help you.

    Mihir,
    Software Professional
    http://mihirhere.spaces.live.com
Page 1 of 1 (6 items)