custom error page not redirecting, but showing web.config

Discussion in 'ASP .Net' started by darrel, Aug 6, 2008.

  1. darrel

    darrel Guest

    I'm trying to set up a web.config file (2.0) so that all 404 errors are
    redirected to another page.

    What happens instead of the redirect, however, is that the browser tries
    loading the actual web.config xml file.

    This a) is wrong and b) seems like a huge security issue that IIS is
    actually serving the XML file.

    Any ideas what I'm doing wrong?

    Here's the config:


    <configuration>
    <appSettings/>
    <connectionStrings/>
    <system.web>
    <compilation debug="true" strict="false" explicit="true" />
    <pages>
    <namespaces>
    <clear />
    <add namespace="System" />
    <add namespace="System.Collections" />
    <add namespace="System.Collections.Specialized" />
    <add namespace="System.Configuration" />
    <add namespace="System.Text" />
    <add namespace="System.Text.RegularExpressions" />
    <add namespace="System.Web" />
    <add namespace="System.Web.Caching" />
    <add namespace="System.Web.SessionState" />
    <add namespace="System.Web.Security" />
    <add namespace="System.Web.Profile" />
    <add namespace="System.Web.UI" />
    <add namespace="System.Web.UI.WebControls" />
    <add namespace="System.Web.UI.WebControls.WebParts" />
    <add namespace="System.Web.UI.HtmlControls" />
    </namespaces>
    </pages>
    <authentication mode="Windows" />
    <customErrors mode="RemoteOnly"
    defaultRedirect="movingmessage.html">
    <error statusCode="404" redirect="movingmessage.html"/>
    </customErrors>
    </system.web>
    </configuration>
    darrel, Aug 6, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Sm9yZ2UgTWF0b3M=?=

    Handling errors and not redirecting to a custom error page

    =?Utf-8?B?Sm9yZ2UgTWF0b3M=?=, Oct 29, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    490
    Matt Berther
    Oct 29, 2004
  2. =?Utf-8?B?TWFkcyBCcnlkZWdhYXJk?=

    web.config custom config handler is not flushed

    =?Utf-8?B?TWFkcyBCcnlkZWdhYXJk?=, Dec 20, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    461
    =?Utf-8?B?TWFkcyBCcnlkZWdhYXJk?=
    Dec 20, 2004
  3. =?Utf-8?B?RGFuIEtyYWltYW4=?=

    forcing cookies to use SSL and redirecting to custom error page

    =?Utf-8?B?RGFuIEtyYWltYW4=?=, Dec 30, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    450
    =?Utf-8?B?RGFuIEtyYWltYW4=?=
    Dec 30, 2005
  4. CSharpner
    Replies:
    0
    Views:
    1,000
    CSharpner
    Apr 9, 2007
  5. T-1000

    Web.config <location> not redirecting

    T-1000, Mar 29, 2006, in forum: ASP .Net Security
    Replies:
    5
    Views:
    582
    Patrick.O.Ige
    Mar 31, 2006
Loading...

Share This Page