views:

28

answers:

1

The following rule works (successfully redirects) for urls like:

www.site.com/some/path

But doesn't work (404) for urls containing + sign:

www.site.com/some/p+a+t+h

And doesn't work (404) even when encoded:

www.site.com/some/p%2Ba%2Bt%2Bh

But works, when + is going after ? sign:

www.site.com/some/path?+

Rule:

<rule name="redirectForWww" stopProcessing="true">
    <match url="(.*)" />
    <conditions>
        <add input="{HTTP_HOST}" pattern="^www.site.com$" />
    </conditions>
    <action type="Redirect" url="http://site.com/{R:0}" />
</rule>

IIS 7.0, URL Rewrite Module 2.0

+1  A: 

The plus sign is a reserved delimiter according to URI spec @ http://labs.apache.org/webarch/uri/rfc/rfc3986.html#reserved

so it cannot (or shouldn't) be used in a file/folder name in a URL. It does however have a use after a ?, in javascript GET data & mailto: links + equates to a space.

JKirchartz