Fix for JRun connector not working with rewrite, but working fine with URIs including .cfm

 I just encountered an interesting set of circumstances that was messing with my Windows "Server" 2003 + ColdFusion 9 + Apache 2.2 + mod_rewrite installation. I ran the JRun Web Server Configuration Tool to create the necessary mod_jrun22 connector details. Apparently, I neglected to check the box for "Configure web server for ColdFusion 9 applications" when doing so because the only file extensions that were explicitly mentioned in the AddHandler directive were .jsp and .jws (rather than .jsp .jws .cfm .cfml .cfc .cfr and .cfswf). This didn't cause an issue with loading a CFML page directly, but did break the rewriting rules.

 
Some rules allows requests such as /mxunit/index.cfm to be passed through to the JRun connector, whereas requests such as /setup/formatDriveC.cfm are not. These rewrite rules worked for a long time on a ColdFusion 8 setup, but failed with ColdFusion 9. Loading /mxunit/index.cfm directly worked, but not when the URI was written to the same effect. The same goes for URIs that take advantage of the DirectoryIndex directive to seek a file named index.cfm. Adding all of the CFML file extensions to the AddHandler directive within the mod_jrun22 conditional section fixed the problem. Go figure.
 
Oh, by the way, troubleshooting these sorts of mod_rewrite problems is not so bad if you enable the RewriteLog and bump RewriteLogLevel up to 4. But be sure you remember to bring it down to -1 afterwards. ;)