Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
1  
Why not use the URLRewriter module for IIS? –  Dscoduc Feb 23 '10 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 '10 at 0:51
    
IIS uses default documents to respond to "/" without redirecting. –  JamesRyan Aug 12 '10 at 11:13

5 Answers 5

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): http://stackoverflow.com/questions/4206053/windows-server-web-config-strip-index-filename

share|improve this answer

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.

share|improve this answer

Here is something suggested by my hosting provider as an alternative to isapi_rewrite because according to them, they lose M$ support by installing 3rd party apps to IIS. Any criticisms of this method?

Possibility: One thing I could do is alter the application mapping so that the ASP.DLL processes "htm" pages. This means you could place asp code on index.htm(and any other htm pages). Like the issue above this could reduce stability somewhat because the pages are not streamed passively but processed like a programming page. Would be as stable as "asp" and is supported by Microsoft.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.