IIS7文件夹名称 - “+”字符是否有效?

时间:2011-11-12 05:16:39

标签: javascript html iis-7 invalid-characters

我正在尝试创建像这样的Google Plus重定向... www.domain.com / +

我创建了一个名为“+”的文件夹,里面有一个简单的default.html文件。 Default.html是一个默认文档,它包含一个简单的JS重定向。我得到一个404文件夹和文件不存在。很奇怪!

文件夹名称的加号appears to be valid所以我很难过。 有什么想法吗?

由于

2 个答案:

答案 0 :(得分:1)

web.config中的301重定向如何:

<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>

编辑:我允许双重转义,禁止IIS7插入+作为空格。解决方案来自:http://www.ifinity.com.au/Blog/entryid/60/404-error-in-iis-7-when-using-a-url-with-a-plus-sign-in-the-path

答案 1 :(得分:0)

在IIS7中,默认情况下,+经常被插值为空格。 IIS7可能允许名为+的文件夹,但URL处理器首先将其插入空格。

请参阅http://www.ifinity.com.au/Blog/entryid/60/404-error-in-iis-7-when-using-a-url-with-a-plus-sign-in-the-path了解解决方法,但这可能会带来安全漏洞。