Rewrite URLs with no extension

129 views
Skip to first unread message

Michael Sprague

unread,
Aug 14, 2018, 9:15:05 PM8/14/18
to UrlRewrite
I'm really struggling with URLRewrite and Tomcat, specifically rewriting URLs without an extension. I'm using Lucee (CFML), but I think this problem is at the Tomcat level.

Here are two rules, the only ones in my .htaccess file.

RewriteRule ^/testpage$ /controller.cfm?permalink=testpage [L]
RewriteRule ^/testpage.cfm$ /controller.cfm?permalink=testpage [L]

The first rule does nothing at all.

www.abc.xyz/testpage just returns a 404 error.

The second rule works.

www.abc.xyz/testpage.cfm rewrites to my controller.cfm script.

It seems like extensionless URLs are not being processed at all by Tomcat. When I check the logs (DEBUG), I see the two rule being test for the testpage.cfm page loads. I do not see the /testpage one being tested at all. It's like the filter never even sees it.

Can anyone point me in the right direction with this?
Reply all
Reply to author
Forward
0 new messages