views:

6

answers:

0

I have read around through some questions and I understand that url rewriting causes issues that others have fixed but I seem to have found an odd case.

I have a News page that is filtered by tags. The Url for a filtered list is:

external: site.com/news/tag/[a tag] internal: site.com/news/view.aspx?filter=[a tag]

When I log in on one of these pages the postback is sent to:

site.com/news/tag/[a tag]?filter=[a tag]

I have read through and implemented the Form.browser and FormRewriter method that changes the Action of forms to the RawURL but this is still happening everytime I log in on a page that has been rewritten.

The rule for my url rewrite is below (using UrlReWritingNet)

  <add name="NewsFilter" virtualUrl="^~/news/tag/(.+)?"
       rewriteUrlParameter="ExcludeFromClientQueryString"
       destinationUrl="~/News/List.aspx?filter=$1"
       ignoreCase="true" />

And I have been able to stop the site crashing using this to match the incorrect url and rewrite it correctly but it won't properly solve the problem:

  <add name="NewsFilterSafe" virtualUrl="^~/news/tag/(\w+)\?(\w+)"
       rewriteUrlParameter="ExcludeFromClientQueryString"
       destinationUrl="~/news/tag/$1"
       ignoreCase="true" />

Any insight would be great Thanks