I had a similar problem using rewrite rules in web.config. Not sure if this will solve your problem either, but I found that when the URL was rewritten, the originally requested URL was accessible through the server variable HTTP_X_ORIGINAL_URL.
VB:
string pathAndQuery = Request.ServerVariables.AllKeys.Contains("HTTP_X_ORIGINAL_URL") ? Request.ServerVariables("HTTP_X_ORIGINAL_URL") : Request.Url.PathAndQuery
FROM#:
string pathAndQuery = Request.ServerVariables.AllKeys.Contains("HTTP_X_ORIGINAL_URL") ? Request.ServerVariables["HTTP_X_ORIGINAL_URL"] : Request.Url.PathAndQuery;
This should give you the source path and query request before rewriting whether the rewriting has occurred.
Charlie
source share