Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

CustomErrors for a 404 code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Lozzi - 24 Aug 2007 20:36 GMT
Howdy,

I'm using the following code, asp.net 2.0

       <customErrors mode="On" defaultRedirect="oops.aspx">
           <error statusCode="403" redirect="notfound.aspx" />
           <error statusCode="404" redirect="notfound.aspx" />
         <error statusCode="500" redirect="oops.aspx"/>
       </customErrors>

A new site rebuild so i want to capture visitors coming in on the old pages.
This doesn't work when the old page is .htm. If I go to a missing .aspx,
like test.aspx, i get the notfound.aspx page and it looks good. If i go to
text.htm I get the generic Page Cannot Be Found error page. Any ideas how I
can get this to work for htm as well?

Thanks,

David Lozzi
Patrick Steele - 28 Aug 2007 03:27 GMT
> Howdy,
>
[quoted text clipped - 11 lines]
> text.htm I get the generic Page Cannot Be Found error page. Any ideas how I
> can get this to work for htm as well?

I believe you need to do that directly in IIS (under the properties for
the virtual directory).  I don't think you can do that in a web.config
(since, by default, .NET doesn't process HTM files).

Signature

Patrick Steele (patrick@mvps.org)
http://weblogs.asp.net/psteele

David Lozzi - 28 Aug 2007 15:43 GMT
Yeah, that's what I figured.

Thanks,

David Lozzi

>> Howdy,
>>
[quoted text clipped - 18 lines]
> the virtual directory).  I don't think you can do that in a web.config
> (since, by default, .NET doesn't process HTM files).

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.