Question

My CFWheels site is running under subfolder/ in the web root, and I have the web.config on the same level as subfolder/. In my web.config I have the necessary URL rewrite rule to remove "subfolder/index.cfm/" from the URL.

My problem arises when I try to include a Javascript file from the default "javascripts" folder using

javaScriptIncludeTag("script.js")

By default, cfwheels looks in /subfolder/javascripts/ for the JS file. However, I've removed subfolder/ from the URL, so a request to /subfolder/javascripts/script.js fails with the following error message:

Wheels.ViewNotFound

Could not find the view page for the javascripts action in the subfolder controller.

Bogus. "javascripts" and "subfolder" are not an action and a controller.

I believe a request to /javscripts/script.js would succeed. How do I tell cfwheels not to look for the javascripts/ folder in subfolder/?

I was unable to find the answer in the documentation, and I haven't gotten any response on the CFWheels Google Group either. I'm looking for an answer such as this, but specific to CFWheels.

edit
IIS 7 web.config rewrite:

<rule name="Remove subfolder/index.cfm">
    <match url="(.*)" />
    <action type="Rewrite" url="/subfolder/index.cfm/{R:0}" />
</rule>

My problem may be here if this rule is incorrect, I'm not sure.

linkTo() actually links to the incorrect path as well.

linkTo(text="Say Hello", controller="say", action="hello")

outputs

<a href="http://mysite.com/subfolder/index.cfm/say/hello">Say Hello</a>

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top