Search code examples
javatomcatmod-jklucee

Lucee, on windows, appending index.cfm on first request to application


I've seen this question: Prevent mod_jk to shows/append index.cfm?&_modcfmlredirected on page load


The first time I'd load a site after server-start, it appends index.cfm. This is a problem because I'm trying to conceal page extensions (as many websites do). The page fails to load because of this.

After that first try, if I try mysite.com/, it loads fine.

I tried the suggestion in the answer on that similar question, (upgrading 1.04 to 1.10, and 1.11) and the only difference is now the first load appends /index.cfm? (adding a question mark).

In the meantime, I have an IIS rule to allow index.cfm.

Before updating the file, I also updated Lucee to Lucee 5.3.3.62


Solution

  • Your site context is being created at runtime. This is what is happening on that first request. To avoid this, simply create the site context at boot time by adding it to Tomcat's server.xml file, located by default in the tomcat/conf/ directory. The file is commented. Simply scroll to the bottom, add the new context so that it matches the comments but has your site's values, then restart.

    HTH