UrlRewritingNet.UrlRewrite assistance RRS feed

  • Question

  • User1963699507 posted

    I am trying to use UrlRewritingNet.UrlRewrite to accomplish the following:

    1) User goes to ~/client/default.aspx and that redirects to ~/login.aspx

    2) I use the rewrite to create a virtual path so that ~/login.aspx shows up as ~/client/login.aspx .  There is no real page ~/client/login.aspx.

    That part works fine.  The issue I have is that if someone bookmarks ~/client/login.aspx and goes to that page, then I need to first redirect back to ~/client/default.aspx and start back at step 1.

    Any suggestions how to accomplish this with UrlRewritingNet.UrlRewrite or some other way?  I realize that i'm going in a circle here but i'm hoping I can differentiate between the rewrite to ~/client/login.aspx and the user actually requesting that.  Thank you.

    Friday, March 20, 2009 11:31 PM


  • User-1136466523 posted


    I'm not sure if i've misunderstood your problem. First, you want to redirect all the coming requests with the format like ~/client/default.aspx to ~/Login.aspx.  Meanwhile, all the requests with the format like ~/client/login.aspx will be redirected to ~/login.aspx. And now what you want is to differentiate between the rewrite to ~/client/login.aspx and the actual reqeusting, right?

    Based on my understanding, you can differentiate these two modes, if the url format mathces the url rewirte format, it would be redirected. In your scenario, you need to create an exception to avoid the ~/Client/Login.aspx page to be redirected. You can use regular expression to make such exception to a specific file.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 25, 2009 2:44 AM