IIS URL Rewrite Module : Rewrite Appends QueryString
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-5开发者_StackOverflow社区c6c-4815-a2b3-3c846651bed9
I don't want the querystring to appear. How can I prevent this. Thanks in advance.
Gr
Martijn
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>
use
form1.Action = Request.RawUrl;
精彩评论