开发者

Redirect “/” to “/web” using IIS7

开发者 https://www.devze.com 2023-04-08 10:29 出处:网络
I\'m hosting a site where I would like for various reasons to have http://开发者_如何学Gomydomain.com automatically redirect to http://mydomain.com/web while at the same time still allowing http://myd

I'm hosting a site where I would like for various reasons to have http://开发者_如何学Gomydomain.com automatically redirect to http://mydomain.com/web while at the same time still allowing http://mydomain.com/foo.html to be served.

Using HTTP Redirect from IIS 7 I seem to be creating an endless redirect loop. Would you have any hints for me?


Give URL Rewrite Module a try. Following code should work for you :

<rewrite>
  <rules>

    <rule name="Redirect example.com to example.comn/web" patternSyntax="ECMAScript" stopProcessing="true">
        <match url="^$" />
        <action type="Redirect" url="/web" />
    </rule>

  </rules>
</rewrite>

How you can get start with Rewrite Module is briefly documented on below post :

http://www.tugberkugurlu.com/archive/remove-trailing-slash-from-the-urls-of-your-asp-net-web-site-with-iis-7-url-rewrite-module

0

精彩评论

暂无评论...
验证码 换一张
取 消