custom error page not redirecting, but showing web.config

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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top