Friday, 8 October 2010

Fix for URL Rewriting With Intelligencia dll and IIS 5.1 Problem

If  a rewritten URL contains GUID( where Guid is encrypted in this example) and extra under  Intelligencia rewriter  and  IS 5.1 or IIS 6 ,  Request.QueryString["guid"]   will always read guid+ extra querystring.
For Example we have a following  rewritten URL.

Though URL have been  precisely configured  in web.config as
<rewrite url="/mysite/Preview/(.+)" to="/mysite/Preview.aspx? guid =$1">rewrite>
However, Request.QueryString["guid”] will always read this URL as

To fix this problem so that Request.QueryString["guid"] gets only Guid part of the URL, place .aspx extension with URL in web.config.

<rewrite url="/mysite/Preview/(.+).aspx" to="/mysite/Preview.aspx? guid =$1">rewrite>

And in code,  place.aspx extension with URL.

 this will generate URL as

and now Request.QueryString["guid”] will read only guid

No comments:

Post a Comment