Hit and Miss with ColdFusion 8

Topics: User Forum
May 12, 2010 at 2:18 AM

I've been having great success using IIRF with "static" content, but it's been kinda hit and miss when trying to use it with ColdFusion 8.

TEST RULES:

RewriteCond %{PATH_INFO} ^/b-(.*)$ [I]
RewriteRule  ^/b-(.*)$ /test.cfm?key=$1 [I,L]

TEST URL: (sample)

http://www.domain.com/b-This-is-a-test.htm

NOTE:  This will rewrite the URL to /test.cfm?key=this-is-a-test.htm

TEST COLDFUSION SCRIPT /test.cfm:



<CFDUMP VAR="#CGI#">

or

<CFOUTPUT>#Now()#</CFOUTPUT>

Occasionally it will work, but it usually gets stuck in the default IIS 404 message.  (What's weird is the 404 message I'm getting is not the one that's configured for use by IIS or ColdFusion.)  The CFDUMP command seems to work pretty reliably, but using something ColdFusion-specific (like the now() function) seems to cause a disrupt.  I'm not exactly sure what it is.  I can stay on the same URL and hit refresh 2-10 times and after a couple of times the page goes from showing the correct content to reliably (incorrectly) displaying a 404 message.  I've been using both Firefox w/Firebug and Google Chrome for testing.

If I wait a minute before performing another request for the page, it seems to work.

I've also added logging to the almost-empty ColdFusion template and have verified that it's only getting called once.  (I read that someone reported that their ColdFusion scripts were executing multiple times per request.)

I think the problem may be the "IncludeIni" directive.  I have a IIRF.ini template in the webroot calling in a shared config file (not global).  When rewriting fails, I view the iirfstatus screen and notice that the site-specific IIRF.ini file is not referenced and only the shared IIRF file is listed.  Sometimes while refreshing the page, it will change between the two webroot and "IncludeIni" IIRF.ini files.

I've rebooted the server and it hasn't make any difference.

Any assistance or insight would be greatly appreciated.

Coordinator
May 12, 2010 at 3:31 AM

I don't know what this part means:

I have a IIRF.ini template in the webroot calling in a shared config file (not global).  When rewriting fails, I view the iirfstatus screen and notice that the site-specific IIRF.ini file is not referenced and only the shared IIRF file is listed. 

What does it mean when you say "the site-specific ini file is not referenced" ? Maybe you can provide a snapshot of what you see in the browser window.

As easy way to test if the problem is related to ini file inclusion is to UN-include all your ini files. Explicitly copy the rules from any included ini file, into the main ini file, and eliminate the IncludeIni directive. Different results? Same? Please share what you learn.

In advance of your testing, which will provide the definitive answer, I doubt that it is the ini-file inclusion thing. That should affect only IIRF startup. I may be wrong of course.

The behavior you described, with the results changing over time, and ONLY on dynamic content (content that flows through the CF engine) suggest something else is at play - a cache, maybe, or a situation in your coldfusion code where a redirect is occurring sporadically. To track this down, a HTTP trace tool like Fiddler can be invaluable.

Aug 2, 2010 at 8:50 PM

I'm returning to add some rules to an IIRF.ini file and am finding that while viewing the irfStatus screen that it keeps reverting to a INI file that is called in with "IncludeIni" after the site-specific rules that I'm adding.

Here are my rules... it adds "index.cfm/" to any non-existent file request that doesn't already have "index.cfm/" in it AND THEN calls a global included INI file:

RewriteCond %{REQUEST_FILENAME}     !-f
RewriteCond %{REQUEST_FILENAME}     !-d
RewriteCond %{HTTP_URL}             (\.htm)$   [I]
RewriteCond %{PATH_INFO}   !^.*(/index.cfm/).*$ [I]
RewriteRule ^(.*)$                    /index.cfm$1 [U,I,L]

IncludeIni ..\_global\IIRF.ini

 

I load the page using the new rules and sometimes get a 404... then I check out iirfStatus and it only indicates that it is using the global rule and doesn't correct itself until I manually refresh/reload the iirfStatus page a couple of times.