you firstly are trying to use fileExists on a URL, so it will always fail,
fileExists requires an absolute path on the server
see here: https://learn.adobe.com/wiki/display/coldfusionen/fileexists

secondly an html page will never reach coldfusion, because it is an html
page, so cfml code will never run.
You need to setup a 404 handler on the web server or use URL rewriting.





On Sun, Feb 2, 2014 at 4:41 PM, Rob Voyle <robvo...@voyle.com> wrote:

>
> Hi Folks
>
> I have a basic ".html" site that I have converted to a coldfusion site.
>
> since there are many old .html links out there I added the following to my
> notFound.cfm file:
>
> <cfif notFoundUrl contains ".html" >
>         <cfset newUrl="http://www.mydomain.com"; &
> replace(notFoundUrl,".html",".cfm")>
>                 <cfif fileExists(newUrl) is "yes">
>                 <cflocation url="#newUrl#">
>                 <cfelse>
>                 <cflocation url="http://www.mydomain.com";>
>                 </cfif>
>         </cfif>
>
> Works fine if the file exists but throws an error if the file doesn't
> exist rather than
> redirecting.
>
> Also which log file would have the error in it as I can't find the error
> in any of the
> logs
>
> What am I missing?
>
> Thanks
> Rob
>
>
>
> 

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

Reply via email to