« Previous Next »

Thread: Look at my URL

Last post 05-14-2009 2:14 PM by ruslany. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 05-14-2009, 8:21 AM

    Look at my URL

    Can someone please take a look at what I have going on here.  I've documented the issues I'm having, along with what I need on this page pretty well... should be self explanatory.  I've also posted the <rule> code on the page for examination... 

    Rewrite: 

    http://www.cbengine.net/1234/comments

    Actual URL: 

    http://www.cbengine.net/product/index.cfm?p=1234&a=comments

    I've been at this for days now and really need to move on to other things... so any help would be awesome.

    Thanks

     

  • 05-14-2009, 12:31 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 7:38 PM
    • Redmond, WA
    • Posts 661

    Re: Look at my URL

    Nice repro!

    Can you clarify this:

    >> however, I do need params passed via querystring attached in the rewrite, including (a=) if not found in pattern <<
     
    Does it mean that if the url is http://www.cbengine.net/1234/comments/?a=graphs&p=5678 then you want to ignore the query string? Can you give an example of the URL where you would use the query string?
    http://ruslany.net
  • 05-14-2009, 1:01 PM In reply to

    Re: Look at my URL

    Thanks for looking at that. 

    What I mean on that part is that in the url below... I'd want the a= and the p= to be stripped from the querystring... as the a= & p= would be found in the match.  but the x= remains intact and get passed back through the rewrite...

    http://www.cbengine.net/1234/comments/?a=graphs&x=1&p=5678

    In this next example I'd only want the p= to be removed from the querystring.  The a= is not present in the match, so the already present a= gets put in it's place.

    http://www.cbengine.net/1234/?a=graphs&x=1&p=5678

    Basically the p= will always need to be stripped form the querystring if present.  Then I just some checks in place to make sure duplicate values are not getting passed around like I explained on that page. 

    Sort of an "either/or but not both" kind of thing... if that makes any sense?  Sorry if it doesn't, I feel like I'm loosing my mind.

     

  • 05-14-2009, 2:14 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 7:38 PM
    • Redmond, WA
    • Posts 661

    Re: Look at my URL

    That makes sense, but I think this kind of logic may be very difficult or impossible to define with rewrite rules. This is because the query string parameters can be in any order, which make the pattern matching and removal of selected parameters from the query string very difficult.

    Unfortunately, right now I do not see a way to implement this logic reliably by using URL rewrite rules. I'll post something here if I come up with a reasonable solution.

    http://ruslany.net
Page 1 of 1 (4 items)
Microsoft Communities