longjumps
asked on
MS IIS 7.5 - HTTP Message Error code customization
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?
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?
ASKER
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?
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I found solution by myself and spent time on that.
Now I am sharing this advanced topic with others.
Now I am sharing this advanced topic with others.
ASKER
However other code, e.g. 205 no problem!