3 Replies Latest reply on Feb 11, 2013 1:45 PM by dbldutch21

    onMissingTemplate not working on sub-directories

    dbldutch21

      Hi, I have an application where onMissingTemplate would fire off when any missing .cfm file was executed.  This was in CF9, I upgraded to CF10 and it no longer works as expected.  Is there a setting I need to change in CF10?

       

      CF9

      /application.cfc - with onMissingTemplate

      /doesnoteexist.cfm - Fires onMissingTemplate

      /nofolderhere/doesnoteexist.cfm - Fires onMissingTemplate

       

      CF10

      /application.cfc - with onMissingTemplate

      /doesnoteexist.cfm - Fires onMissingTemplate

      /nofolderhere/doesnoteexist.cfm - DOES NOT fire onMissingTemplate

       

      Thanks for any help!

        • 1. Re: onMissingTemplate not working on sub-directories
          Adam Cameron. Level 5

          I think there's something you're not telling us, or there's something else afoot. Your examples all work fine for me.

           

          You don't tell us what web server you have configured, which is possibly relevant. I'm just testing with the inbuilt web server. This proves from a ColdFusion pov the functionality is A-OK, but does not determine whether there's a problem with the web server connector, or whether some config needs to take place on the web server too.

           

          Are you getting a CF error message, or a web server error message?

           

          Also, the file is Application.cfc, not application.cfc. It doesn't matter so much on Windows, but it's good to get these things right. It will not affect your current problem though.

           

          --

          Adam

          • 2. Re: onMissingTemplate not working on sub-directories
            dbldutch21 Level 1

            You're correct, I did miss some details.

             

            I'm on a new windows computer that is running Apache with CF10.  My old windows computer was Apache with CF9.  I copied the http.conf and vhost.conf files from the old computer and put them on the new computer so I assumed all the settings would be the same.

             

            I've looked through all my settings and I cannot find any mod-rewrites or settings that would allow onMissingTemplate to work inside the same folder but not in missing sub-directories.

             

            Thanks for any tips you might have!

            • 3. Re: onMissingTemplate not working on sub-directories
              dbldutch21 Level 1

              Using this example

               

              CF10

              /application.cfc - with onMissingTemplate

              /doesnoteexist.cfm - Fires onMissingTemplate

              /nofolderhere/doesnoteexist.cfm - DOES NOT fire onMissingTemplate

               

              If I create the directory "nofolderhere" (but not doesnoteexist.cfm) it does work.  It's just having trouble with the the missing templates inside the missing directories.

               

              I believe this is an issue with apache as I uploaded to my server which runs IIS and it is working as long as I have the "jakarta" virtual directory added.

               

              Thanks for any help!