views:

209

answers:

1

Hi There

I have the following rewrite rule.

 <rule name="cheapbastardz.signupcode" stopProcessing="true">
     <match url="^signup/code/([_0-9a-z-%=\+\$]*)$" />
     <conditions>
     </conditions>
     <action type="Rewrite" url="Page.aspx?sc={R:1}" appendQueryString="false" />
 </rule>

Now when the user click on a buton where the page is posted back the url changes from

http://localhost/CBAanmelding/signup/code/3f69fa28-5c6c-4815-a2b3-3c846651bed9

to

http://localhost/CBAanmelding/signup/code/3f69fa28-5c6c-4815-a2b3-3c846651bed9?sc=3f69fa28-5c6c-4815-a2b3-3c846651bed9

I don't want the querystring to appear. How can I prevent this. Thanks in advance.

Gr

Martijn

A: 

Are you sure your rule is firing?

The match pattern does not seem to fit the incoming URL. The incoming URL begins with /CBAanmelding, while your pattern looks for URLs that bbegin with signup. The circumflex preceding the word signup is a zero-width assertion that the pattern matches only at the beginning of the URL.

Maybe you need to change the pattern?

 <rule name="cheapbastardz.signupcode" stopProcessing="true">
     <match url="^CBAanmelding/signup/code/([_0-9a-z-%=\+\$]*)$" />
     <conditions>
     </conditions>
     <action type="Rewrite" url="Page.aspx?sc={R:1}" appendQueryString="false" />
 </rule>
Cheeso
I'am sure it's firing. That's just the virtual application directory. It doesn't look at that part. I think the issue isn't with the rule it is just that a postback appends the sc key.
Martijn B
I don't see Page.aspx in your rewritten URL. Which makes me wonder if it is firing.
Cheeso