• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

status code 500 instead of cfheader 410

New Here ,
Mar 22, 2012 Mar 22, 2012

Copy link to clipboard

Copied

Hi,

I want to show status code 410, but instead of it, it shows status code 500.

i use iis7 and coldfusion 9

someone can know why?

this is my code:

  <cfheader statuscode="410" statustext="Gone" />

<cfinclude template="../cgi-bin/file_not_found.cfm">

<cfabort>

this is my application.cfc file:

<cfcomponent output="No">

    <cfinclude template="f/login.cfm" >

   

<!--- <cfinclude template="f/security.cfm"> --->

<cfset this.clientmanagement=true>

<cfset this.sessionmanagement="yes">

<cfset this.name="UL">

<cfset this.clientstorage="cookie">

<cfset this.setclientcookies="true">

<cffunction name="OnSessionStart">

        <!--- 1111 --->

<!--- set defualt buyer session anyway! --->

<cfset SetDefaultBuyer()>

<cfset SetDefaultSeller()>

<!--- define session and client mylist --->

<cfset session.mylist="">

<!--- <cfif isdefined("client.mylist")><cfset session.mylist=client.mylist><cfelse><cfset session.mylist=""><cfset client.mylist=""></cfif> --->

<!--- trying to login as user --->

<cf_LoginCookies>

<cfif FindNoCase('pa_',CGI.PATH_TRANSLATED) AND ( NOT ISDefined("session.user.status")) >

    <cflocation addtoken="No" url="#Application.URL#/p_login/login_form.cfm">   

</cfif>

</cffunction>

<cffunction name="OnApplicationStart">

<cfinclude template="including/global_variables.cfm">

</cffunction>

<cffunction name="onRequestStart" returnType="boolean">

<!---

<cfif CGI.REMOTE_ADDR IS "81.218.200.52">

    <cfelse>

    <cfoutput><br> <br> <br>

<h2 align="center">Sorry,<br>

We are in process of maintenance.<br>

Please try at 10:00 AM<br>

Now is #Timeformat(now())#</h2></cfoutput>

<cfabort>   

</cfif>

--->

       

                <!--- 2222 --->

                <!--- Neged atacks --->

                <cfparam name="CGI.QUERY_STRING" default="222">

                 <cfif FindNoCase('Declare',CGI.QUERY_STRING)>

                <cfabort>

                </cfif>

                <cfif Len(CGI.QUERY_STRING) GT 400>

                <cfabort>

                </cfif>

                

                

                <!--- im menase lirot MyUL bli lihiot LogIn --->

                <cfif FindNoCase('pa_',CGI.PATH_TRANSLATED) AND ( NOT ISDefined("session.user.status")) AND ( NOT ISDefined('form.type') )>

                <cflocation addtoken="No" url="#Application.URL#/p_login/login_form.cfm">

                </cfif>

            

                <cfreturn True>

</cffunction>

                        <cfif CGI.HTTP_HOST IS not "192.168.1.223">

                    <cffunction name="onError">

                    

                        <cfargument name="Except" required=true/>

                        <!--- Log all errors in an application-specific log file. --->   

                        <!--- define message --->

                        <cfif isdefined('except.cause.cause.message')>

                        <cfset message=except.cause.cause.message>

                        <cfelseif isdefined('except.cause.message')>

                        <cfset message=except.cause.message>

                        <cfelse>

                        <cfset message=''>

                        </cfif>

                       

                        <!--- define template --->

                        <cfif isdefined('except.cause.tagcontext')>

                        <cfset template=except.cause.tagcontext[1].template>

                        <cfset line=except.cause.tagcontext[1].line>

                        <cfelse>

                        <Cfset template=''>

                        <Cfset line=''>

                        </cfif>

                       

                      <!--- define second template --->

                     <cfif arraylen(except.cause.tagcontext) gt 1>

                     <cfset template= template & ',' & except.cause.tagcontext[2].template>

                     <cfset line=line & ',' & except.cause.tagcontext[2].line>

                     <cfelse>               

                     </cfif>

                    

                       <!--- define third template --->

                     <cfif arraylen(except.cause.tagcontext) gt 2>

                     <cfset template= template & ',' & except.cause.tagcontext[3].template>

                     <cfset line=line & ',' & except.cause.tagcontext[3].line>

                     <cfelse>               

                     </cfif>

                    

                         <cfset text="Message: #message# , template:#template# , line:#line#">

                                            

                                            

                    <!---  define sql --->

                    <cfif isdefined('except.cause.sql')>

                    <cfset text=text & ' , sql:' & except.cause.sql>

                    </cfif>

                   

                      <cflog file="MyAppLog" type="error" text="#text# ,client_ip: #cgi.REMOTE_ADDR# , url:#cgi.HTTP_URL#,ref:#cgi.HTTP_REFERER#">

                        <cfinclude template="/including/error.cfm">

                       <!---  <cflocation addtoken="false"  url="#application.url#/including/error.cfm?message=#message#&template=#template#&line=#line#">

                        ---> </cffunction></cfif>

                   

                   

<cffunction name="onRequest" returnType="boolean">

<cfargument name="targetPage" type="String" required=true/>

 

<cfinclude template="f/security.cfm">

<cfinclude template="#Arguments.targetPage#">

  

<cfreturn True>  

</cffunction> 

<!---

    <cferror type = "request"  

        template = "../including/error.cfm"

        mailto = "dtpozner@gmail.com"> --->

<cffunction name="onRequestEnd" returnType="boolean">

<cfreturn True>

</cffunction>

</cfcomponent>

and this is my web.config:

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

    <system.webServer>

        <rewrite>

            <rules>

                <clear />

                <rule name="C page detailed">

                    <match url="^(.*)/(.*)-(.*)/cc_(.*)_s(.*)" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="/c_page/index.cfm?id={R:4}&cat_id={R:5}&manuf={R:2}&model={R:3}" />

                </rule>

                <rule name="C page less detailed">

                    <match url="/cc_(.*)_s(.*)" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="/c_page/index.cfm?id={R:1}&cat_id={R:2}" />

                </rule>

                <rule name="C Pages">

                    <match url="/cc_(.*)" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="/c_page/index.cfm?id={R:1}" />

                </rule>

                <rule name="B Page Pnumbers" stopProcessing="true">

                    <match url="/bb_(.*)_pn(.*)" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="category/c_index.cfm?cat_id={R:1}&pnumber={R:2}" />

                </rule>

                <rule name="B Pages">

                    <match url="/bb_(.*)" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="category/c_index.cfm?cat_id={R:1}" />

                </rule>

                <rule name="TM Guide B Pages">

                    <match url="/tmm_(.*)" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="tm_guide/cat_view.cfm?cat_id={R:1}" />

                </rule>

                <rule name="TMGuide C Page">

                    <match url="/tmc_(.*)" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="tm_guide/model.cfm?model_id={R:1}" />

                </rule>

                <rule name="T&M-Buying-Guide" stopProcessing="true">

                    <match url="^T&M-Buying-Guide" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="tm_guide/index.cfm" />

                </rule>

                <rule name="Home Page">

                    <match url="^$" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="/homepage/index.cfm" />

                </rule>

                <rule name="A Page Pnumbers">

                    <match url="/aa_(.*)_pn(.*)" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="category/m_index.cfm?main_id={R:1}&pnumber={R:2}" />

                </rule>

                <rule name="A Pages">

                    <match url="/aa_(.*)" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="category/m_index.cfm?main_id={R:1}" />

                </rule>

                <rule name="GogglePageModeID">

                    <match url="/gm_model_id(.*)" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="model/model_index.cfm?model_id={R:1}" />

                </rule>

                <rule name="GoogleModelManufCat">

                    <match url="/gmm_model(.*)_manuf(.*)_cat(.*)" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="model/model_index.cfm?model_id={R:1}&manuf={R:2}&cat={R:3}" />

                </rule>

                <rule name="old b_pages" stopProcessing="true">

                    <match url="^b(\d+?)p(\d+?)pr(\d+?)-.*\.htm" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Redirect" url="category/c_index.cfm?cat_id={R:1}&pnumber={R:2}&old=1" />

                </rule>

                <rule name="old c_pages" stopProcessing="true">

                    <match url="^c(\d+?)s(\d+?)-(.*?)_(.*?)\.htm" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Redirect" url="/c_page/index.cfm?id={R:1}&cat_id={R:2}&manuf={R:3}&model={R:4}&old=1" />

                </rule>

                <rule name="old c page no model" stopProcessing="true">

                    <match url="^c(\d+?)s(\d+?)-(.*?).htm" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Redirect" url="/c_page/index.cfm?id={R:1}&cat_id={R:2}&manuf={R:3}&old=1" />

                </rule>

                <rule name="old b_tb_pages" stopProcessing="true">

                    <match url="^b-(.*?)pn(\d+?)-.*\.htm" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Redirect" url="tm_guide/cat_view.cfm?cat_id={R:1}&old=1" />

                </rule>

                <rule name="old c_tb_pages" stopProcessing="true">

                    <match url="^c-(.*?)-.*\.htm" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Redirect" url="tm_guide/model.cfm?model_id={R:1}&old=1" />

                </rule>

                <rule name="old b_model_page" stopProcessing="true">

                    <match url="^b_model_mf(.*?)_mo(.*?)_pn(.*?)-.*\.htm" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="CustomResponse" statusCode="410" statusReason="Removed" statusDescription="Removed" />

                </rule>

                <rule name="old b_manuf_sec_all" stopProcessing="true">

                    <match url="^cgi-bin/a_dinamic/b_manuf_sec_all.cfm(.*)" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Redirect" url="http:www.used-line.com" appendQueryString="false" />

                </rule>

                <rule name="result.cfm" stopProcessing="true">

                    <match url="^cgi-bin/a_dinamic/result.cfm" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="list_of_categories/categories.cfm" />

                </rule>

                <rule name="old b model">

                    <match url="^.*_.*_m(.*?).htm" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="model/model_index.cfm?model_id={R:1}" />

                </rule>

                <rule name="old b model mfr cid">

                    <match url="^.*_.*_2m(.*?)_2mnf(.*?)_2cid(.*?).htm" />

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="model/model_index.cfm?model_id={R:1}&manuf={R:2}&cat={R:3}" />

                </rule>

            </rules>

        </rewrite>

       

    </system.webServer>

</configuration>

thanks for your answers.

Views

2.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 23, 2012 Mar 23, 2012

Copy link to clipboard

Copied

LATEST

In any case, you shouldn't be doing any includes in Application.cfc(side note: capital A). The application file is not meant for presenting CFM pages. Translate all such includes into logic involving, for example, cflocation.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation