使用IIS7从Default.aspx重定向到根目录

问题描述:

当请求到达www.example.com/default.aspx时,我希望它发送到www.example.com的301.该怎么做?

When request comes to www.example.com/default.aspx, I want it to 301 to www.example.com. How to do that?

PS-我尝试了许多规则,但似乎无济于事.谢谢.

PS - I tried many rules but nothing seems to work. Thanks.

您是否尝试过使用URL重写并遵循以下规则:

Have you tried using URL Rewrite with the following rule:

<rule name="Default Document" stopProcessing="true"> 
  <match url="(.*)default.aspx" /> 
  <action type="Redirect" url="{R:1}" redirectType="Permanent" /> 
</rule>