Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / IIS / IIS General Topics / December 2005

Tip: Looking for answers? Try searching our database.

Change HTTP Header returned to client.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
adelscott@gmail.com - 29 Dec 2005 14:46 GMT
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 - 29 Dec 2005 14:50 GMT
I Forgot to tell that I am using ASP.NET
David Wang [Msft] - 30 Dec 2005 04:11 GMT
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".

Signature

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

>I Forgot to tell that I am using ASP.NET
adelscott@gmail.com - 30 Dec 2005 09:37 GMT
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
 
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



©2010 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.