Redirect root URL - IIS 7

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

My site lives in c: \ IronNoob and my forums are set to c: \ IronNoob \ forums

I want ironnoob.com and www.ironnoob.com to redirect to the server page ironnoob.com \ forums.

I use IIS 7 and I'm new to creating this stuff, so I don’t even know what Google is for. I know that I can do client side redirects using HTML, but I understand that server side redirection is more enjoyable. I figured out how to install the HttpRedirect module for IIS, but if I configured redirection in the root folder of my site to the folder of my forums, I get a circular error when redirecting when visiting ironnoob.com.

HTTP redirect settings:

  • root directory selected in the ISS Connections panel
  • Check "Redirect requests to this destination"
  • destination = http://somesite.com/forums
  • Check "redirect all requests to exact location"
  • Check "only redirect requests for content in this directory (not subdirectories)"
  • Status Code: Permanent (301)

Why does it redirect subdirectories when I said it is not? What is the right way to do this?

+8
windows url-rewriting iis
source share
1 answer

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

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

URL rewrite configuration

Click on Add a rule in the right pane. Select Blank rule in incoming rules:

Blank rule

Here you must specify your rule and select the option Does not match the pattern . Then you need to install Pattern (in this case, this means that a URL starting with forums will invoke this rule):

Rule conditions

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

Redirect rule

Click Apply in the right pane and you will be well off.

NOTE. If your Redirect URL does not match your Pattern , you are stuck in an infinite loop (you can test it by simply clicking the Test button, it will write your Pattern ).

The documentation for this module is available here.

+23
source share

All Articles