Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > CustomErrors for a 404 code

Reply
Thread Tools

CustomErrors for a 404 code

 
 
David Lozzi
Guest
Posts: n/a
 
      08-24-2007
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

 
Reply With Quote
 
 
 
 
Patrick Steele
Guest
Posts: n/a
 
      08-28-2007
In article <(E-Mail Removed)>,
http://www.velocityreviews.com/forums/(E-Mail Removed)am says...
> 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?


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).

--
Patrick Steele ((E-Mail Removed))
http://weblogs.asp.net/psteele
 
Reply With Quote
 
 
 
 
David Lozzi
Guest
Posts: n/a
 
      08-28-2007
Yeah, that's what I figured.

Thanks,

David Lozzi


"Patrick Steele" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> In article <(E-Mail Removed)>,
> (E-Mail Removed)am says...
>> 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?

>
> 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).
>
> --
> Patrick Steele ((E-Mail Removed))
> http://weblogs.asp.net/psteele


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Read <customErrors> element via VB.NET Code? =?Utf-8?B?TWlrZQ==?= ASP .Net 9 02-08-2007 10:24 PM
Intercept IIS 404 errors? Issue with Viewstate and 404 Jonathan Folland ASP .Net 2 03-17-2005 02:32 AM
<customErrors .... not working?? =?Utf-8?B?cmV6YQ==?= ASP .Net 1 02-18-2004 11:52 PM
CustomErrors statusCode 500 Jesse Napier ASP .Net 3 08-07-2003 09:07 PM
customErrors 404 NRao ASP .Net 1 07-01-2003 04:33 PM



Advertisments