|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
status code 200 logged in log fileHi
I have iisstart.htm,error404.htm(custom error page) pages in my web application for . When a user reuests page and resource is not found on web server then the web server executes iisstart.htm and not the error404.htm, bacause of which the status code logged in IIS log file shows as 200 instead of 404 error code. Can you please advise on how to get the error404.htm page logging 404 code in IIS? Thanks in advance. RA On May 26, 4:19 pm, Raj <R***@discussions.microsoft.com> wrote:
Show quoteHide quote > Hi Your custom error page needs to run code to set the status code that> > I have iisstart.htm,error404.htm(custom error page) pages in my web > application for . When a user reuests page and resource is not found on web > server then the web server executes iisstart.htm and not the error404.htm, > bacause of which the status code logged in IIS log file shows as 200 instead > of 404 error code. > > Can you please advise on how to get the error404.htm page logging 404 code > in IIS? > > Thanks in advance. > > RA gets logged. For example, using an ASP or ASP.Net URL as custom error page. If you use static HTM as custom error, then IIS will not process the HTM and send it as is with the proper status code logged. That's how the static error pages work by default. //David http://w3-4u.blogspot.com http://blogs.msdn.com/David.Wang // Thanks...
i will explain the situation. I have CMS 2002 site hosted in IIS 6.0. I am looking at the IIS log files where the status codes are not logged properly. In IIS Virtual directory , in documents tab the pages mentioned are default.htm default.asp index.htm iistart.htm In Error tab we have mentioned the URL error404.aspx for 404 status code. In web.config file the customerror is set as ; <customErrors mode="On" defaultRedirect="~/error.aspx" /> 1) Whever a page is not found we get the custom error404.aspx but the IIS log file shows 200 as status code. I think by implementing your suggestion i.e. inserting <% Response.Status ="404 Not Found" %> at the begning of error404.aspx page we can get the 404 as status code logged in IIS when when page/resource is not found. Please correct me if I am wrong? 2) Sometimes we get the IISSTART.HTM being displayed , I am not understanding why IISSTART.HTM page is displayed (anyway this is not related to the above step 1). Can you please let me know when and in what scenarios this page gets executed ? Recently I got this page being displayed when there was some problem on database server which our application uses (as database space was full). When I see the IIS log file it logged 500 as status code. Thanks in advance. Ra Show quoteHide quote "David Wang" wrote: > On May 26, 4:19 pm, Raj <R***@discussions.microsoft.com> wrote: > > Hi > > > > I have iisstart.htm,error404.htm(custom error page) pages in my web > > application for . When a user reuests page and resource is not found on web > > server then the web server executes iisstart.htm and not the error404.htm, > > bacause of which the status code logged in IIS log file shows as 200 instead > > of 404 error code. > > > > Can you please advise on how to get the error404.htm page logging 404 code > > in IIS? > > > > Thanks in advance. > > > > RA > > > Your custom error page needs to run code to set the status code that > gets logged. For example, using an ASP or ASP.Net URL as custom error > page. If you use static HTM as custom error, then IIS will not process > the HTM and send it as is with the proper status code logged. That's > how the static error pages work by default. > > > //David > http://w3-4u.blogspot.com > http://blogs.msdn.com/David.Wang > // > Hi David
Can you please send me some samples of how to code for custom error code for logging in IIS log files. Thanks Ra Show quoteHide quote "David Wang" wrote: > On May 26, 4:19 pm, Raj <R***@discussions.microsoft.com> wrote: > > Hi > > > > I have iisstart.htm,error404.htm(custom error page) pages in my web > > application for . When a user reuests page and resource is not found on web > > server then the web server executes iisstart.htm and not the error404.htm, > > bacause of which the status code logged in IIS log file shows as 200 instead > > of 404 error code. > > > > Can you please advise on how to get the error404.htm page logging 404 code > > in IIS? > > > > Thanks in advance. > > > > RA > > > Your custom error page needs to run code to set the status code that > gets logged. For example, using an ASP or ASP.Net URL as custom error > page. If you use static HTM as custom error, then IIS will not process > the HTM and send it as is with the proper status code logged. That's > how the static error pages work by default. > > > //David > http://w3-4u.blogspot.com > http://blogs.msdn.com/David.Wang > // >
Other interesting topics
Single Sign On Intranet Windows Username Authentication (ASP.NET)
How to solve Error message 401.2 in IIS 5.1? Certificate Options IIS 6 AUX command - is it patched? Where to put my IIS WebServer ? Help with HTTP 401.2 - Access is denied error Backing up an IIS server Is Exchange 2003 OWA vulnerable to Security Advisory (971492) - We Internet Authentication Service 2003 Server - ODBC authentication? Domain authentification in a DMZ |
|||||||||||||||||||||||