I used a fairly simple method to do this.  Example below is not
precisely to your scenario but it does catch a particular folder in
the path and do something with it in a 404 handler.  You can do
whatever you like with respect to string handling.  In your case its
not even necessary.  Just set thisURL to the url you desire and you're
off to the races.

I originally tried to use a cfinclude to display the page rather than
a cfhttp call.  Discovered you can't do that in CF from the error or
404 handler.  Some kind of special behavior where includes won't work;
even if my handler was physically in the site's web root.  However
after running the thing I found that -- to my amazement -- a cfhttp
call from a server to itself presented zero noticeable reliability or
load concerns on a heavily trafficked site.

<cfset is404="true">
<!---
run all of your cases for 404 redirection here.
Only one will be displayed next
--->
<!---
is "sales" a folder in the url?
--->
<cfif FindNoCase("sales/",cgi.path_info,"1")>
        <!---
        yes.  this is not a 404
        --->
        <cfset is404="false">
        <!---
        create the dynamic url.  Expected incoming format for this one is
        http://domain/sales/item_123,cfm where "123" is the PK
        --->
        <cfset 
url.ID=ListLast(ListFirst(ListLast(cgi.Script_Name,"/"),"."),"_")>
        <cfset thisURL="#server.rootURL#saleslistings/item.cfm?ID=#url.ID#">
</cfif>
<!---
did we NOT hit one of the special handling cases?
--->
<cfif not is404>
        <!---
        get the page
        --->
        <cfhttp
                url="#thisURL#"
                method="GET"
                timeout="20"
                resolveurl="YES"
                port="80">
        </cfhttp>
<cfelse>
        <!---
        your 'genuine' 404 handling code goes here
        --->
</cfif>

-- 
[EMAIL PROTECTED]
Janitor, MSB Web Systems
mysecretbase.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254754
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to