I am using IIS7 URL rewriting with my website which is written in ASP.NET. I am not sure the best way to deal with / in the rewritten URL because currently, when one is present it breaks the parameters because the engine thinks it needs to split it at the wrong place. For example, a url like:
www.test.com/myscript.aspx?code=dothis&title=tester/title
would be split incorrectly. “tester” would become the code and “title” the title. Is there any way I can prevent this or is it simply the case that you can’t use /s because the engine splits the URL on them?
Thanks.
The
URLEncodefunction can be used to re-encode backreferences. For example:When you’re dealing with separate URL components, like single path parts or parameter values (which is the vast majority of the time), you will want to
URLEncode; IMO it’s a highly questionable bit of design that this doesn’t happen (a) by default or (b) in the rules generated by Add Rule wizard.