we have a URL rewrite rule that randomly passes an incorrect query string parameter to the page. it happens out of nowhere, lasts for about a minute and then everything just starts working fine again. Here is the rule: match url="/c/([^?/]+)/([^?/]+)" action
type="Rewrite" url="/templates/display/category/default.aspx?SGid={R:2}" So this URL: /us/en/c/[whatever]/190 should be rewritten to /templates/display/category/default.aspx?SGid=190 When we noticed this happening we put a hidden field on the page to hold
the value of the rewritten parameter for comparison and it does not show that 190 is being passed ( it shows other valid category ID's) the incorrect value is almost always "20" (for /us/en/c/[whatever]/20) but it can vary. We have other rules that are working
fine. is this some sort of caching on the server? Any help you could provide would be greatly appreciated. we are running IIS 7.5 on windows 2008R2 thanks
Thanks for the tip. I didn't realize you could trace status code 200 in the failed trace log. I will give it a try, hopefully it can shed some light as to what is happening.
thanks I will try this as well. unfortunately this happens randomly and only lasts for a minute. I have the failed trace rule set up but not turned on as I don't want the overhead of tracing every click when the issue is not happening. I am hoping to catch
it happening and enable rule to try to figure out what is going on. Is their caching involved with the rewrites that may be causing the issue?
I'm really at a loss as to what is happening here?
I was able to catch it in action using failed request tracking.
Here are the results of the trace log:
according to the log it appears that it is working fine but on /category/default.aspx if we output the value of the SGID query string parameter it show a completely diferent ID then what the trace log shows that it is passing through to the page...
Does anyone have any idea as to what is happening?
jminorini
4 Posts
URL rewrite passing incorrect query string values
Nov 12, 2012 03:00 PM|LINK
Rules rewrite url pattern rewrite <rewrite> rewriterule rewritten url parameter cache rewrite rules URL Rewriting IIS 7 aspx Rewrite module re_write rewrite iis UR rewrite rewrite problem re_write iis re_write iis server [ web.config] Rewrite-Rules Server re_write iis server reverse proxy re_write web.config query stirng incorrect parameter
Rovastar
3321 Posts
MVP
Moderator
Re: URL rewrite passing incorrect query string values
Nov 12, 2012 04:54 PM|LINK
Use failed request tracing for troubleshooting URLrewrite
http://www.iis.net/learn/extensions/url-rewrite-module/using-failed-request-tracing-to-trace-rewrite-rules
jminorini
4 Posts
Re: URL rewrite passing incorrect query string values
Nov 13, 2012 04:38 PM|LINK
Dalong Zhang...
647 Posts
Microsoft
Re: URL rewrite passing incorrect query string values
Nov 14, 2012 02:29 AM|LINK
Hi,
Failed request tracing can filter requests via status codes, so if you set status code range 200-900, it should capture all the requests.
Feedback to us
Develop and promote your apps in Windows Store
Dalong Zhang...
647 Posts
Microsoft
Re: URL rewrite passing incorrect query string values
Nov 14, 2012 02:32 AM|LINK
Hi,
You can try adjusting your rule a little and check if that works well.
match url=".*/c/([^?/]+)/([^?/]+)"
Thanks.
Feedback to us
Develop and promote your apps in Windows Store
jminorini
4 Posts
Re: URL rewrite passing incorrect query string values
Nov 15, 2012 06:46 PM|LINK
thanks I will try this as well. unfortunately this happens randomly and only lasts for a minute. I have the failed trace rule set up but not turned on as I don't want the overhead of tracing every click when the issue is not happening. I am hoping to catch it happening and enable rule to try to figure out what is going on. Is their caching involved with the rewrites that may be causing the issue?
jminorini
4 Posts
Re: URL rewrite passing incorrect query string values
Dec 06, 2012 04:18 PM|LINK
I'm really at a loss as to what is happening here?
I was able to catch it in action using failed request tracking.
Here are the results of the trace log:
RULE_EVALUATION_START
RuleName="Structure Groups", RequestURL="us/en/c/wood/20", QueryString="", PatternSyntax="Regex", StopProcessing="true", RelativePath="/"
PATTERN_MATCH
Pattern=".*/c/([^?/]+)/([^?/]+)", Input="us/en/c/wood/20", Negate="false", Matched="true"
REWRITE_ACTION
Substitution="/templates/display/category/default.aspx?SGid={R:2}", RewriteURL="/templates/display/category/default.aspx?SGid=20", AppendQueryString="true", LogRewrittenURL="false"
according to the log it appears that it is working fine but on /category/default.aspx if we output the value of the SGID query string parameter it show a completely diferent ID then what the trace log shows that it is passing through to the page...
Does anyone have any idea as to what is happening?
Rovastar
3321 Posts
MVP
Moderator
Re: URL rewrite passing incorrect query string values
Dec 06, 2012 05:06 PM|LINK
try logRewrittenUrl="true" to see what appears in the IIS logs