How to get query string right before a slash

89 Views Asked by At

There are weird occasions where our website is accessed with the following url:

http://website.com/search/?category=test&keyword=test

As you can see there is a weird slash sitting in front of the question mark and this fools my asp.net mvc app to think there is no query string. Now the client wants the slash removed (SEO issues), hence redirecting the user to

http://website.com/search?category=test&keyword=test

Apparently Request.Url.Query returns empty string :( what is the best way to correctly parse the query string if theres a slash before it in asp.net mvc?

0

There are 0 best solutions below