So, I’ve recently made the switch on my local dev machine (macosx) to lucee from acf. It mirrors production perfectly (ubuntu), with apache in the front. I then switched over 3 sites that I still had left on a production server running acf - some small changes and all seemed good. Until I started getting a bunch of 404’s.
It seems, I’m guessing due to the proxymatch setup in apache, that all .cfm/.cfc files bypass the .htaccess altogether. While this isn’t a problem for your normal rewrite feature (assuming you aren’t rewriting to a file ending in .cfm), it is a problem for any redirect/rewrite you want to do that ends in .cfm/.cfc, including for example common security disallows blocking access to things like web.cfm/server.cfm. In this case I noticed it primarily due to a bunch of old redirects from when these sites had files ending in .cfm. I can move these to the 404 template, and perhaps that is better, but I would really like to learn if this is normal, or if it can be worked around? It obviously worked in acf.
So, in my virtualhosts file an entry has for example:
<Directory "/Users/Sites/XXX/"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> <Proxy *> Allow from 127.0.0.1 </Proxy> ProxyPreserveHost On ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://localhost:8009/$1$2
And then in .htaccess, the following will work:
RewriteRule ^testing1234.html /1234.html [R=301,L]
But this doesn’t:
RewriteRule ^testingsdfa.cfm /bladadf.html [R=301,L]
I’m on the latest version of Lucee both development and production. I noticed this old thread Apache and .cfm mod_rewrite not working which seems to have the same problem, but I can’t figure out what exactly that user did to resolve things (set up mod_proxy from the .htaccess?). Any thoughts/ideas on the best way to proceed here. I’m also happy to throw out the .htaccess altogether if needed - I just want a long term fix that works the same in dev/production.
Thanks in advance for any pointers!