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>
i think the problem is that you are forgetting to negate the javascript and other folders for cfwheels.
i did i writeup the covered this a while back:
http://rip747.wordpress.com/2009/02/23/cfwheels-url-rewriting-in-a-subfolder/
though this was for a different url rewriter i'm sure you could port the rules to IIS7.