title: Rewrite rule not working with apache2, lucee tomcat
body: <p>I have configured server with lucee tomcat and apache2 for virtual host on ubuntu. I have enabled rewrite rule and my virtual host is as followes.</p>
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerAdmin admin@example.com
      ServerName example.com
      ServerAlias example.com www.example.com
      DocumentRoot /var/www/html/example.com/
  
      &lt;Directory /var/www/html/example.com/&gt;
          Options Indexes FollowSymLinks
          AllowOverride All
          Require all granted
      &lt;/Directory&gt;
  
      ErrorLog ${APACHE_LOG_DIR}/error_main_example.log
      CustomLog ${APACHE_LOG_DIR}/access_main_example.log combined
      DirectoryIndex index.cfm
  &lt;/VirtualHost&gt;
  
  </code></pre>
  <p>redirect from htaccess file is working good but rewrite rule is not working. Here is the htaccess file that i am trying.</p>
  <pre><code>RewriteEngine On
  
  RewriteCond %{HTTP_HOST} !^www\. [NC]
  RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
  
  RewriteCond %{HTTP:X-Forwarded-Proto} !https
  RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
  
  RewriteRule ^(.*)/abc/([0-9]+)$ /test-404.cfm [L]
  </code></pre>
  <p>Here are the example URLs:</p>
  <pre><code>https://www.example.com/example.cfm/abc/2
  https://www.example.com/example.cfm/abc/8
  https://www.example.com/example.cfm/abc/15
  </code></pre>
  <p>It is showing me tomcat 404 error that</p>
  <pre><code>HTTP Status 404 – Not Found
  
  Type Status Report
  
  Message The requested resource [/example.cfm/abc/2] is not available
  
  Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
  Apache Tomcat/9.0.35
  </code></pre>
  <p>Can any body help me about this issue. By the way, site is configured using classic load balancer on AWS.</p>