I am using the following line of code in several places in a ColdFusion website application, which will cause the page to respond with a 403 error code, but, IIS6 does not show the 403 error as specified in "Custom Errors". This happens whether I use the default settings, the built-in IIS error pages, or my own custom URL or File setting:
Application.cfc:
<cffunction name="onRequestStart" returntype="Boolean">
<cfargument name="targetPage" type="String" required="true" />
<cfif notAuthorized>
<cfheader statusCode="403" statusText="Forbidden" />
<cfreturn false />
</cfif>
<cfreturn true />
</cffunction>
This code properly triggers the 403 error in IIS7/7.5, but not in IIS6.
Why is this happening and how can I resolve the issue?