Given url /Page.aspx?a=b&title=apples+%26+pears
, Request.Url
property returns /Page.aspx?a=b&title=apples+&+pears
Note that the url-encoded ampersand in the second key-value pair has been automatically decoded. Other url-encoded reserved characters aren't being automatically decoded.
Is this behaviour correct?
EDIT: The issue is that Request.Url property is automatically decoding the encoded ampersand when I don't expect it to.
ANSWER: string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Host, Sitecore.Context.Request.RawUrl)