MS IIS 7.5 - HTTP Message Error code customization

Posted on 2011-05-02
Medium Priority
Last Modified: 2012-05-11
In my filter inside of IIS7.5 for some conditions I am deciding to send blocking message.
Generally I am using HTTP code 200.
But sometime there is a need to send another one.
When another one is chosen and it is not in the range 400-500 everything is ok and message is going out of IIS with this HTTP code and relevant content I put.

But if I choose for example HTTP code 403 - IIS intercepting it, putting HTTP code 200 and embed the code I custom to 403 inside of HTML body.

Can somebody advice on this?
Question by:longjumps
  • 4

Author Comment

ID: 35510309
Attached is the example of what happen with response message that was send to browser from IIS 7 when I am trying to send block message from one of filters with HTTP code 403.
However other code, e.g. 205 no problem!

Author Comment

ID: 35689135
I did more test on this issue so once I browse some site from local browser or curl tool I am getting correct message for block with content I am expecting.
However once I browse for same site that from my IIS module I am sending blocking message with Error Code IIS takes "ownership" and send his 403 message instead of mine that was customise in my IIS module.

This happens only in IIS7, with error codes  4xx and 5xx, other codes I succeeded override and IIS7 is not overriding them again.

Can somebody help on this?


Accepted Solution

longjumps earned 0 total points
ID: 35695862

Author Closing Comment

ID: 35695875
I found solution by myself and spent time on that.

Now I am sharing this advanced topic with others.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question