Redirect root URL - IIS 7

前端 未结 1 580
耶瑟儿~
耶瑟儿~ 2020-12-31 16:21

I have some forums installed on my site at http://ironnoob.com/forums.

My website lives in c:\\IronNoob and my forums are installed in c:\\IronNoob\\forums

I

相关标签:
1条回答
  • 2020-12-31 17:03

    Instead of using the HTTP redirect module, you can use the URL rewrite one.

    Run the inetmgr command and select your website root. Open the URL rewrite configuration:

    URL rewrite configuration

    Click on Add a rule on the right panel. Select a Blank rule in inbound rules:

    Blank rule

    From here you have to name your rule and select the Does not match the pattern option. You then have to set the Pattern (in this case, it means that a URL not starting with forums will trigger this rule):

    Rule conditions

    The last step is to set up your redirect. You probably want to go with a 301 redirect as advised by Google:

    Redirect rule

    Click Apply on the right panel and you should be good to go.

    NOTE: If your Redirect URL doesn't match your Pattern you will be stuck in an infinite loop (you can test it by simply clicking the Test button will writing your Pattern).

    Documentation for this module available here

    0 讨论(0)
提交回复
热议问题