Redirect from Default.aspx to root using IIS7

心已入冬 提交于 2019-12-25 00:36:24

问题


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

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


回答1:


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> 


来源:https://stackoverflow.com/questions/3085860/redirect-from-default-aspx-to-root-using-iis7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!