Rewrite Mode for CFWheels Root Site

I need advice on researching the following problem.

The Wheels site has a set(URLRewriting="On") configured, everything looks great except for the root page.

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

But in the / mode it "switches" to partial, and the links look like website.tld/index.cfm/controller/action . Interestingly, if the default route page was explicitly accessible (/ pages / index in this case), the correct URLs.

The website runs on Tomcat with Apache2 under Ubuntu, the standard wheel rewrite rules configured directly in the vhost configuration as a workaround to a known issue with .htaccess.

Where to begin? What variables can be checked and how to debug it?

Thanks.

UPD All that I see at the moment is that with the default action for direct access there is no Route: home in the debug output. Not sure how to use this information, I have very little experience with wheels.

+2
source share
2 answers

Since Chris Peters did not create an answer, I will do it instead to mark the question. All glories to Chris, in any way.

Typically, Wheels ignore set (urlRewriting = "On") unless you rewrite rewrite.cfm. Make sure requests are routed through rewrite.cfm and not index.cfm

This means that you need to check the CGI area on the problem pages and fix the crawl bypass rules (for some of them for Tomcat + CFWheels, I think).

+2
source

I have a very similar setup, and I ran into the same problem just now. As a temporary workaround, I found that by changing the line of 294 wheels /global/public.cfm from

 loc.returnValue = application.wheels.webPath & ListLast(request.cgi.script_name, "/"); 

to

 loc.returnValue = application.wheels.webPath; 

that linkTo () built a path that worked with URL rewriting. I will ping friends who are familiar with Wheels to see if a fix is ​​needed to fix it.

+2
source

Source: https://habr.com/ru/post/958884/


All Articles