rewrite rule redirects on postback

Jul 2, 2010 at 12:03 PM

hi,

i have the following rule:

RewriteRule ^/([^/\.]+)/(reset)$ /$2.aspx?id=$1 [L,I] 

the rule is meant to map

http://mysite.com/91A6F7B/reset 

to

reset.aspx?id=91A6F7B
this works perfectly when the page is first loaded, however when a postback occurs this rule seems to run again and the original url becomes

http://mysite.com/91A6F7B/reset?id=91A6F7B

is there a way to prevent the rule running again? or have i written it wrongly?

 

 

 

Jul 2, 2010 at 7:53 PM

There is a PostBackUrl property, I believe, for buttons. Try explicitly assigning a postbackurl (on page load) to:

http://mysite.com/91A6F7B/reset 
Jul 3, 2010 at 1:01 AM

but surely this will not stop the rule from firing

Jul 4, 2010 at 11:00 PM

well what do you know, setting the postback url on the button did the trick. tnx very much