PC Review


Reply
Thread Tools Rate Thread

custom error page not redirecting, but showing web.config

 
 
darrel
Guest
Posts: n/a
 
      6th Aug 2008
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>




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Web.Config Timeout Expired Redirect Custom Error Page =?Utf-8?B?R3JhbnQ=?= Microsoft Dot NET 2 3rd Feb 2006 10:35 PM
forcing cookies to use SSL and redirecting to custom error page =?Utf-8?B?RGFuIEtyYWltYW4=?= Microsoft ASP .NET 0 30th Dec 2005 04:22 PM
Re: Error when redirecting to an asp page from an aspx page Loui Mercieca Microsoft ASP .NET 1 3rd Sep 2005 05:31 PM
Handling errors and not redirecting to a custom error page =?Utf-8?B?Sm9yZ2UgTWF0b3M=?= Microsoft ASP .NET 2 29th Oct 2004 07:17 PM
redirecting assemblies, but not in GAC or .config file EP Microsoft Dot NET Framework 0 12th Aug 2004 12:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:00 AM.