D
darrel
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>
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>