<cfset fileOutput = '<cflocation url="#longURL#" addtoken="false" />' />
One might ask why you're using directories and CFM files to accomplish this task. Every web server supports rewriting engines which would allow you to use a single script and a database to accomplish this task in a far more streamlined fashion. Further, you almost certainly want to be doing a 301 instead of a 302 to the long URL, which CFLOCATION doesn't provide. If you opt to continue down this route, probably want to use CFHEADER instead. cheers, barneyb On Thu, Mar 26, 2009 at 4:43 PM, Cameron Johnson <john...@nais.org> wrote: > > Hi, all. > > I've been out of coding for too long and I can't figure this one out. > > Simple, really: using CFDIRECTORY and CFFILE, I want to create a folder, drop > in an index.cfm file, then put a <cflocation> tag in that index.cfm file. > > <!--- create directory ---> > <cfdirectory action="CREATE" directory="d:\test\#newDirectory#" /> > > <!--- create index.cfm file in new directory ---> > <cffile action="WRITE" file="d:\test\#newDirectory#\index.cfm" > output="#fileOutput#" /> > > What I can't solve is how to write the CFLOCATION tag into the fileOutput > variable. The resulting tag will be: > > <cflocation url="#longURL#" addtoken="false" /> > > I tried putting that into a CFSAVECONTENT, but that was actually processing > the the redirect. > > Any help here? > > Thanks, > > Cameron > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321023 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4