For the very oldest URLs, you're better off doing an internal rewrite such that when .cfm URLs are requested, a brand new PHP file is internally invoked. This logic in this file does all the fancy stuff for constructing the new URL and sending a 301 redirect out. It's important that this PHP script also correctly returns 404 status for non-valid .cfm requests. This reduces the .cfm request handling within htaccess to just a few lines. However you do it, do be aware that the 301 redirect must state both protocol and hostname as well as the new path.