wongrm
February 22, 2024, 10:59pm
1
Hello,
I’m trying to get the path_info from an Application that isn’t being served at the Lucee root. I’m able to get path_info data at the root for example:
However, when I go to a subdirectory I’m getting a 404.
When trying to just access index.cfm in the subdirectory this isn’t any issue.
Any help would be greatly appreciated.
Thanks
Base image pulled down from Docker Hub: lucee/lucee:5.4
andreas
February 24, 2024, 6:41pm
2
Hi could you please give an full example of the URL that is breaking? This may be handled with an URL-Rewrite rule.
1 Like
wongrm
February 26, 2024, 3:57pm
3
Of course. It’s any route with index.cfm that isn’t at the root. For example:
http://localhost:8854/test-app/index.cfm/controller/action
http://localhost:8854/test-app/sub-dir/index.cfm/controller/action
I think I’m pretty close to solving though. I was able to get a response by adding this last line in /usr/local/tomcat/conf/web.xml hardcoding the path into:
<servlet-mapping>
<servlet-name>CFMLServlet</servlet-name>
<url-pattern>*.cfm</url-pattern>
<url-pattern>*.cfml</url-pattern>
<url-pattern>*.cfc</url-pattern>
<url-pattern>/index.cfm/*</url-pattern>
<url-pattern>/index.cfc/*</url-pattern>
<url-pattern>/index.cfml/*</url-pattern>
<url-pattern>/test-app/index.cfm/*</url-pattern>
I tried a few other wildcard pattern for a solution that would be more generic but I kept getting errors when starting the container.
andreas
February 26, 2024, 5:42pm
4
As far as I know multiple wildcard patterns won’t work within web.xml url-pattern directive.
What I’d try to do in such scenarios is get the full URI with the front server with url-Rewrite and pass it to a central index.cfm file. All the swiching logic happens then in cfml within your Application.cfc.
wongrm
February 26, 2024, 5:56pm
5
Thanks! So, would that url-Rewrite be done with Tomcat if I’m just using the base Lucee:5.4 container?