Specify default root path?

75 views
Skip to first unread message

Riley Watkins

unread,
Mar 23, 2011, 2:36:40 PM3/23/11
to ColdFusion on Wheels
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 (script.js)
using javaScriptIncludeTag(). By default, cfwheels looks in /subfolder/
javascripts/ for the JS file, except that 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 site
controller."

I believe a request to /javscripts/script.js would succeed, however.
How do I tell cfwheels not to look for the javascripts/ folder in
subfolder/? I was unable to find the answer in the documentation.

Risto

unread,
Mar 25, 2011, 4:11:20 PM3/25/11
to ColdFusion on Wheels
Sounds like an issue with the rewrite rule. In the meantime including
the js file not using the javaScriptIncludeTag() is always an option.

Risto

unread,
Mar 25, 2011, 4:18:45 PM3/25/11
to ColdFusion on Wheels
Can you not just keep "subfolder" in the url. I've run wheels apps out
of subdirectories like www.abc.com/blog
where cfwheels is installed in a subdirectory named blog and I've
never had any issues once you setup the rewrite rule. Of course I
wanted to have "blog" as part of my URL.
Don't know if that's your case though.

Riley Watkins

unread,
Mar 25, 2011, 5:38:26 PM3/25/11
to ColdFusion on Wheels
Yes, I can actually get the site to run fine if I keep the subfolder
name in the URL. But I'm actually trying to run the site from a
subfolder as if it were at the root. In other words, I'm trying to
avoid needing the subfolder name in the URL.

Brad Gunn

unread,
Mar 25, 2011, 6:18:48 PM3/25/11
to cfwh...@googlegroups.com, Riley Watkins
Can you paste in your url rewrite ? This is all possible with Apache.


--
You received this message because you are subscribed to the Google Groups "ColdFusion on Wheels" group.
To post to this group, send email to cfwh...@googlegroups.com.
To unsubscribe from this group, send email to cfwheels+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfwheels?hl=en.




--
Test

Riley Watkins

unread,
Mar 25, 2011, 8:00:25 PM3/25/11
to ColdFusion on Wheels
I'm on IIS 7, actually. But here's the URL rewrite:

<rule name="ColdFusion on Wheels URL Rewriting" enabled="true">
<match url="^(.*)$" ignoreCase="true" />
<conditions logicalGrouping="MatchAll">
<add input="{SCRIPT_NAME}" negate="true" pattern="^/(flex2gateway|
jrunscripts|cfide|cfformgateway|railo-context|files|images|
miscellaneous|stylesheets|robots.txt|sitemap.xml|rewrite.cfm)($|/.*
$)" />
</conditions>
<action type="Rewrite" url="/site/rewrite.cfm/{R:1}" />
</rule>

Risto

unread,
Mar 26, 2011, 3:16:55 PM3/26/11
to ColdFusion on Wheels
Hi,

I've done this in the past- I put /site in two places

<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Asterisk Rewriting" enabled="true">
<match url="^(.*)$" ignoreCase="true" />
<conditions logicalGrouping="MatchAll">
<add input="{SCRIPT_NAME}" negate="true" pattern="^/site/
(flex2gateway|jrunscripts|cfide|cfformgateway|railo-context|files|
images|media|javascripts|miscellaneous|stylesheets|robots.txt|
sitemap.xml|rewrite.cfm)($|/.*$)" />
</conditions>
<action type="Rewrite" url="/site/rewrite.cfm/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Reply all
Reply to author
Forward
0 new messages