views:

52

answers:

2

I'm having an issue with bad requests from certain search parameters.

An example URL:

http://www.foo.com/washington/forums/search/%26

Results in a bad request.

The rewriter config line looks like this:

<rewrite url="^(.*)/forums/search/(.*)" to="~/Pages/Forums/Overview.aspx?Address=$1&amp;q=$2" processing="stop" />

I'm thinking it's an issue with the Regex...?

Thanks in advance!

A: 

%26 is url-encoded &

So the query string of the rewritten URL becomes Address=www.foo.com/washington&q=& which is not well-formatted due to the trailing &

I think you'll have to encode the string before passing to the url-rewriter

Amarghosh
sgbinks
A: 

Issue and solution discussed here:

http://dirk.net/2008/06/09/ampersand-the-request-url-in-iis7/

sgbinks