我曾尝试:如何使用IIS7 URL重写模块重定向到应用程序根目录?
1)我第一次尝试空字符串:
<action type="Redirect" url="" redirectType="Permanent" appendQueryString="false" />
结果:
HTTP 500.52 - URL Rewrite Module Error.
The substitution URL for the current action cannot be empty.
2)也许我应该省略url
属性:
<action type="Redirect" redirectType="Permanent" appendQueryString="false" />
相同结果:
HTTP 500.52 - URL Rewrite Module Error.
The substitution URL for the current action cannot be empty.
3)怎么样的ASP.NET方式:
<action type="Redirect" url="~" redirectType="Permanent" appendQueryString="false" />
设法重新指向{APP_ROOT}/~
。
4)最后一次尝试:
<action type="Redirect" url="/" redirectType="Permanent" appendQueryString="false" />
正如预期的那样,它重定向到服务器的根......
我想找到一些干净的通用的解决方案。 (我不能用一些具体/myCurrentAppPath
)
+1好吧。谢谢。 – 2010-05-11 12:36:57