Colbox app + blogcfc

21 views
Skip to first unread message

Dan Vega

unread,
May 28, 2011, 8:41:42 PM5/28/11
to col...@googlegroups.com
I am working on redoing my personal site and I have a quick question. Almost my whole site is going to be written using Coldbox (home/about/projects/etc) but my blog is going to be a standalone app using blogcfc. How can can I combine the 2 so /blog is its own application? Just a little confused on how to handle this, any insight is appreciated. 

Dan

Aaron Greenlee

unread,
May 28, 2011, 9:28:19 PM5/28/11
to col...@googlegroups.com
If you just drop BlogCFC in /blog the Application.cfc will make it its own application. You wont need to do anything special.

-Aaron

Dan Vega

unread,
May 29, 2011, 1:19:37 PM5/29/11
to col...@googlegroups.com
That worked fine and the home page of blogcfc loads fine but whenever I go into an actual entry ColdBox is taking over for some reason.


5-29-2011 1-16-12 PM.png

Dan Vega

unread,
May 29, 2011, 4:07:01 PM5/29/11
to col...@googlegroups.com
I am pretty sure this has something to do with the default route but I am not sure how to tell Coldbox to ignore any requests that start with /blog

anyone? 

Andrew Scott

unread,
May 29, 2011, 8:20:25 PM5/29/11
to col...@googlegroups.com

Are you using SES ISAPI rewrite with that domain?

 

You might need to add a rule in there to stop blogCFC from being rerouted back to the main ColdBox application.

 

 

Regards,

Andrew Scott

http://www.andyscott.id.au/

 

 

 

--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/coldbox
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org

Aaron Greenlee

unread,
May 30, 2011, 12:02:42 PM5/30/11
to col...@googlegroups.com
Andrew has it I think.

You need to add a rewrite rule the stops processing for "^blog" or "^/blog" (depending on which rewrite solution/server you are using). The default urlrewrite filters are mapping /blog to /index.cfm/blog which is kicking off the ColdBox app.

Here is an example of some rules that stop processing for IIS:

                <rule name="Application Adminsitration" stopProcessing="true">
                    <match url="^(.*)$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{SCRIPT_NAME}" pattern="^/(.*(CFIDE|cfide|CFFormGateway|jrunscripts|railo-context|fckedito r)).*$" ignoreCase="false" />
                    </conditions>
                    <action type="None" />
                </rule>

And, here is another for Tuckey URLRewrite which I use for my blog hosted by TomCat/Railo which rewrites anything that does not match:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.2//EN" "http://tuckey.org/res/dtds/urlrewrite3.2.dtd">
<urlrewrite>
<rule>
<note>
Enable TomCat to have SES links.
</note>
<condition type="request-uri" operator="notequal">\.(bmp|gif|jpe?g|png|css|js|txt|pdf|doc|xls|xml|cfc|ico|php|asp)$</condition>
<from>^/(?!cdn|src|railo-context|test|mxunit|remote|monitoring|root)(.*)$</from>
<to>/index.cfm/$1</to>
</rule>
</urlrewrite>


Dan Vega

unread,
May 30, 2011, 2:30:09 PM5/30/11
to col...@googlegroups.com
I am using apache mod_rewrite but I am not sure thats the whole issue...

this url works


but this does not and is caught by ColdBox


if you look in config/routes.cfm you will see the default route. Is that catching the request and trying to do something with it? That would explain /blog does not go through the request. 

// Your Application Routes
addRoute(pattern=":handler/:action?");


Aaron Greenlee

unread,
May 30, 2011, 3:09:21 PM5/30/11
to col...@googlegroups.com
That's exactly why I think your rewrite rule is routing the "http://localhost/danvega/blog/2011/5/13/cfObjective-2011-Presentation-code-and-slides" to this: "http://localhost/danvega/index.cfm/blog/2011/5/13/cfObjective-2011-Presentation-code-and-slides" which is why ColdBox is getting it. If you post your .htaccess file, I can add the rule directly or you can just modify an existing rule to include "^/blog" to stop processing. If you are using one of the common .htaccess files you should be able to just append the "/blog" to an entry for "railo-context" or "cfide".

-Aaorn

Dan Vega

unread,
May 30, 2011, 3:16:50 PM5/30/11
to col...@googlegroups.com
ok I added that and that worked out..but I just realized that my issues were because of some setup I had in blogcfc. thanks for the help guys! 

Aaron Greenlee

unread,
May 30, 2011, 3:48:01 PM5/30/11
to col...@googlegroups.com
Sweet! 

Can't wait to see you show us all up with your new site. Would be funny if you snatched all Ben Nadel's photos and photoshoped your face over his :)

-A

Andrew Scott

unread,
May 30, 2011, 7:07:49 PM5/30/11
to col...@googlegroups.com

You will need something in your rewrite rules to ignore the /blog directory.

 

RewriteRule ^(blog) - [L]

 

 

Regards,

Andrew Scott

http://www.andyscott.id.au/

 

 

 

--

Reply all
Reply to author
Forward
0 new messages