Search code examples
tomcatcoldfusionurl-rewritingapache2cfwheels

Different rewrite mode for CFWheels website root


I need an advice on researching the following issue.

Wheels website has set(URLRewriting="On") configured, everything looks fine except root page.

All links built with linkTo look like website.tld/controller/action.

But on a / mode "switched" into the partial and links look like website.tld/index.cfm/controller/action. Interestingly, if default route page accessed explicitly (/pages/index in this case) -- URLs built properly.

Website is running in Tomcat with Apache2 under Ubuntu, standard Wheels rewriting rules configured directly in a vhost config, as a workaround to known issue with .htaccess.

Where to start? What variables to check and how to debug this?

Thanks.

UPD All I can see for now is that when default action accessed directly there's no Route: home in the debug output. Not sure how to use this info, I have very small experience with Wheels.


Solution

  • Since Chris Peters did not create the answer, I'll do this instead just to mark the question resolved. All glory to Chris, any way.

    Usually Wheels will ignore set(urlRewriting="On") if you're not rewriting to rewrite.cfm. Make sure that requests are routing through rewrite.cfm and not index.cfm

    It means that you need to check the CGI scope on the problematic pages and fix the rewriting workaround rules (there are few of them for Tomcat+CFWheels, I think).