6

I used the technique explained here for IIS (http://www.webconfs.com/how-to-redirect-a-webpage.php), but this appears to result in an infinite loop when applied to "/index.htm" and redirected to "/". Is there another way to do this in IIS so that it doesn't loop infinitely?

This page is static HTML, so I can't implement an ASP or ASP.net solution. Any ideas?

3
  • 1
    Why not use the URLRewriter module for IIS?
    – Dscoduc
    Feb 23, 2010 at 23:50
  • What page are you wanting to redirect to? "/" is not a page that IIS understands, so unless you have some ISAPI_FILTER that understands how to process a request to "/" you are doomed.
    – Jeff
    Feb 24, 2010 at 0:51
  • IIS uses default documents to respond to "/" without redirecting.
    – JamesRyan
    Aug 12, 2010 at 11:13

4 Answers 4

2

If you are using IIS7, your application (even if it is just a static HTML site) can have a web.config. Have a look at the following post and see if this helps in setting up your rewrite rule (assuming you can use the IIS Rewrite module for your site): https://stackoverflow.com/questions/4206053/windows-server-web-config-strip-index-filename

0

As it's static html you need to use a URL rewriter; a ISAPI filter that intercepts http requests before they're processed, so the URL can be translated. The main one is ISAPI Rewrite and it costs about $100. This capability is native in Apache.

The method described in the URL you posted will not work in your case.

0

you can create a /index.html/ directory and put a default.asp file with the proper redirect, this is the dirty solution. To enable the isapi filter you must have access to the iis console.

0

Is this because of legacy/external links or because of internal links made by whatever tool is used to manage the content? If the former, you could make your real index page be called something else and that name higher in the IIS default page options, and then index.htm can be set to redirect to / without a loop.

If it's to get around a page generation tool with problematic internal links, this wouldn't work as the links would also get updated to that alternative filename. However if the main page isn't edited often and a little manual work is acceptable, leaving it as index.htm and manually making a copy to whatever name is set for the IIS default could allow it to work.

You must log in to answer this question.