I had this very "problem" when creating one of the Websites I used to own. IIS 
doesn't pass directory requests through to ColdFusion, so you will have to do 
some handling in your custom 404.

In your 404.cfm, look at the CGI.HTTP_REFERER value. It will contain 404; and 
some other stuff. The other stuff is what you want to parse to determine where 
the user was going. I have some code somewhere, which I might not be able to 
dig up until this evening if you would like it.

Thanks,
Paul

Paul Day
Principal / Developer

410.241.8465
[email protected]
http://www.nucomsolutions.com/

----------------------------------------

From: "Matthew P. Smith" <[email protected]>
Sent: Wednesday, August 11, 2010 7:12 AM
To: "cf-talk" <[email protected]>
Subject: getting path of not existent directory 

I am trying to use a custom 404 to serve more se friendly pages.

Using application.cfc, I can properly serve this page, using the
onMissingTemplate method:

domain.com/art/paintings-21/index.cfm

I am parsing the path obtained from #arguments.template# to get the key(21)
and display the page by calling /404.cfm with the template info.

I am having trouble doing the same with this, though:
domain.com/art/paintings-21/

It does not seem to invoke the onMissingTemplate method, and rather calls
/404.cfm directly.

So in the CGI scope, I have:

SCRIPT_NAME=/404.cfm

PATH_INFO=

How can I access the "/art/paintings-21/" to get the info I need? I
would like the page displayed for both:

domain.com/art/paintings-21/index.cfm

domain.com/art/paintings-21/



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336183
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to