I would put that in a .htaccess file or make sure your rewrite rules are loaded after your mod_cfm or mod_proxy rules.
plus if your virtual host is running CFML, then you have to have the allow and order rules in the virtual host directive, or it will only work for your global default web configuration.
Thanks Terry, I’ll try that, though I’m a little confused as to which mod_ is doing the connecting now.
Below my virtual host for the site, there is this:
I think this gets auto added when installing Lucee (its been a while). does this seem right?
Its wierd, but on the dev server, if I comment out the ajp:// lines in the virtual host, CFM still gets served, I’m wondering if somehow this aint right…
OK, tried that, put the <IfModule mod_before the virtual host, put the rewrite rules after the proxy_module inside the virtualhost, restarted everything, cleared browser cache etc - still getting the problem with the cfm redirect rule, the resulting page appends the CFTOKEN and CFID to the url and throws a too many redirects error
Set mod_rerwite log to level 4
output is multiple lines like this, till I close the page.
(timestamp/IP stuff) init rewrite engine with requested uri /synth/accesindigo.cfm
(timestamp/IP stuff) (1) pass through /synth/accesindigo.cfm
(timestamp/IP stuff) (2) pass through /synth/accesindigo.cfm
You can see that its not applying the mod_rewrite rule this just enters loop of lines like this (1), (2) and we get the too many redirects loop. This is driving me a bit mad now.
Sorry about this, next test: I removed the rules from htaccess and put them directly in the virtual host, log just passes it through, applies no rules.
If it works in the .htaccess and not in the directive, then issue is where the DocRoot is for your virtual directive and when the rewrite rules are being applied.
Apache HTTPD Server configuration is applied sequentially.
You more than likely have your Virtual Directive applied before you have you have your load modcfml.
You need to switch it so your modcfml is loaded first, then your virtual configuration.
Thanks again for your patience;
Okay so using that, I get an error when restarting the httpd - calling mode_cfml twice,
so I binned the call outside the virtual directive.
But the rewrite not working still from inside the virtual directive.
Just checking inside the virtual directive means this:
are you using HTTPD 2.2 or 2.4? IIRC, Apache changed some syntax between these 2 versions, especially as related to <Directory> blocks. We had issues when upgrading from 2.2 to 2.4
Yeah, I cant see why it is not working, I’m unable to get any rewriterules to work in the virtualhost.
Server is running apache under apache, lucee under root, starting to look like I might have to do a total rebuild of this server, I tried the lucee change user and it broke everything
Nick - would you be willing to post the final config setup that worked for you? I’m struggling with something similar (htaccess being sort of ignored and url rewriting not working) albeit I’m on Windows and running Apache 2.4. I’m looking for any model that might get URL rewriting working for me.
I realize this is a post that is a few years old but I too would be interested in seeing the final config. I have tried all number of things, and this is the only post I can find that accurately describes the problem, with some suggested fixes, but none seem to work.
Getting the .htaccess to work is not the problem, it’s rewrites/redirects inside it that include a .cfm file (old files that need a redirect for example). I’m guessing this is related to the proxymatch side of things.