IIS Server - Change HTTP Header returned to client.

This is Interesting: Free IT Magazines  
Home > Archive > IIS Server > December 2005 > Change HTTP Header returned to client.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Change HTTP Header returned to client.
adelscott@gmail.com

2005-12-29, 6:04 pm

I configured IIS to redirect error 404 to the default page of the site.
Is there anyway to send http code 404 in the default page ?

adelscott@gmail.com

2005-12-29, 6:04 pm

I Forgot to tell that I am using ASP.NET

David Wang [Msft]

2005-12-30, 3:00 am

If using IIS Custom Error page, then make sure it is a URL Custom Error page
to an ASP page and use Response.Status to change the code to "404".

If using ASP.Net-specific Custom Error, figure out how to do something
similar within ASP.Net.

The question is mostly not an IIS question since when IIS sends a Custom
Error, it always sends the necessary HTTP Status Code -- but when you use
Custom Error Page generated via some dynamic handler like ASP/ASP.Net, you
are responsible for doing the right thing regarding status code. IIS no
longer owns the request.

Re: Terminology -- HTTP Status Code is NOT the same as "HTTP Header".

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//

<adelscott@gmail.com> wrote in message
news:1135867811.865499.133490@g44g2000cwa.googlegroups.com...
>I Forgot to tell that I am using ASP.NET
>



adelscott@gmail.com

2005-12-30, 7:56 am

Thanks, I found this late this night.
When IIS redirects 404 error to a custom page the QueryString contains
the error # and the page that raised the error. I can check the
QueryString on the default page to know if browser is comming from an
error page or not.

In aspx the code is Response.StatusCode = 404

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com