IIS 7: Redirect all request to Default.aspx

Posted by EtienneT on Stack Overflow See other posts from Stack Overflow or by EtienneT
Published on 2009-04-13T20:36:35Z Indexed on 2010/06/10 23:32 UTC
Read the original article Hit count: 363

Filed under:
|
|

We want to redirect all request in an ASP.NET site to ~/Default.aspx to close the site. We are using IIS7. The site has paths like this that return a page:

http://test.com/operating

We are using url rewriting. We want requests similar to those to be redirected to ~/Default.aspx

http://test.com// http://test.com/.aspx http://test.com//.aspx

We would normaly use something like this in web.config:

    <customErrors mode="On" defaultRedirect="Default.aspx">
        <error statusCode="404" redirect="Default.aspx" />
    </customErrors>

The problem with this is that it won't redirect folder url like this

http://test.com/*/

Thanks!

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about iis