1

I'm attempting to create a Google Plus redirect like this... www.domain.com/+

I have created a folder named "+" with a simple default.html file inside. Default.html is a default document and it contains a simple JS redirect. I get a 404 like the folder and file do not exist. Very strange!

The plus character appears to be valid for folder names so I'm stumped. Any ideas?

Thanks

Joe Hakooz
  • 573
  • 1
  • 5
  • 18
  • Just curious, does `www.domain.com/%2B` work? –  Nov 12 '11 at 05:29
  • And, can you access say, a "Hello World" HTML file in said `+` folder? (e.g. does this question really have anything to do with either JavaScript or HTML?) –  Nov 12 '11 at 05:31
  • .../%2b didn't work and it is currently setup as hello world for troubleshooting. No luck yet. You're right about the js and html tags. I was enjoying the tag adding process a little too much I guess. – Joe Hakooz Nov 12 '11 at 06:37

2 Answers2

1

How about a nice 301 redirect in a web.config:

<configuration>
    <system.webServer>
        <security>
            <requestFiltering allowDoubleEscaping="true" />
        </security>
    </system.webServer>
    <location path="+">
        <system.webServer>
        <httpRedirect enabled="true" destination="http://plus.google.com/{userprofileid}" httpResponseStatus="Permanent" />
        </system.webServer>
    </location>
</configuration>

Edit: I allowed double escaping which disables IIS7's interpolation of a + as a space. Solution obtained from: http://www.ifinity.com.au/Blog/entryid/60/404-error-in-iis-7-when-using-a-url-with-a-plus-sign-in-the-path

Jason
  • 3,379
  • 25
  • 32
  • I may end up using this or a URL rewrite, but I was hoping to share a simple technique for the technically challenged. – Joe Hakooz Nov 12 '11 at 06:47
  • Fair enough. I wish I knew of the server-side answer to your dilemma. Thanks for the +1. – Jason Nov 12 '11 at 06:52
  • 1
    The oshineye.com/+ example works with JS disabled so maybe it can only be done with web.config or equivalent technique. Asking Google this question proved difficult given the keywords involved. – Joe Hakooz Nov 12 '11 at 06:56
  • Go to http://www.webconfs.com/http-header-check.php and input "oshineye.com/+" He is definitely using a 301 redirect on the server side. – Jason Nov 12 '11 at 06:59
  • Upon further investigation, the above 301 redirect does not work. It is simply ignored. URL Rewrite 2 does not work either. I'm starting to believe this is an IIS limitation. Using the tool you mentioned above I determined that oshineye.com is an Apache server. Unfortunately I don't have access to an apache server to test :-( – Joe Hakooz Nov 12 '11 at 15:52
  • 1
    @JoeHakooz: Notice the edit I made above. This turns off IIS7 escaping, including the interpolation of a + as a space. This should work for you, but read the source link above for potential security issues. – Jason Nov 13 '11 at 23:33
  • Booyah! Nailed it Jason. Thanks again. One note... the system.webserver node should be inside the configuration node. – Joe Hakooz Nov 14 '11 at 04:22
0

In IIS7, by default, + is often times interpolated as a space. IIS7 may allow for folders named +, but the URL processor is interpolating it first to a space.

See http://www.ifinity.com.au/Blog/entryid/60/404-error-in-iis-7-when-using-a-url-with-a-plus-sign-in-the-path for a workaround, but this potentially opens up security flaws.

Jason
  • 3,379
  • 25
  • 32