Blog

Blog Archives - 2 Record(s)

Year: '2016' - Month: '12'

15
December 2016

Gavin Pickin

CommandBox rewrites are easier and more powerful

CFML Server, CommandBox, Lucee, Techie Gotchas

Using CommandBox as my every day dev server is awesome. I know the pain developers feel, trying to run multiple versions of their server software locally. I have even presented at conferences about how to get your host machine setup to run Railo, Lucee, and ACF 9 through ACF 11 on the same machine, with a lot of headaches, but you can do it. There is a demand for that, and to be honest, CommandBox put me out of a job. Although, as great as CommandBox is, for running multiple servers, a couple of things were not that easy, a couple of things the lightweight built in webserver didn't do as well, mainly REWRITES... until now.

Using Apache for several years now, writing rewrites in Apache's mod_rewrite syntax had spoiled me. Commandbox has supported rewriteConfig from the start essentially, with its own built in config, and more recently, with your on web.rewrites.config file option, but it was not the same. I know a lot of people use Tuckey, and it has a lot of power, I just never felt at home. Having to dive into the XML, and setup the rules, and then use them, honestly, I have just been spoiled.

Just recently Brad Wood had mentioned, there was some undocumented, and largely untested rewrites functionality that I might be interested in. He was right, mod_rewrite syntax is now supported in CommandBox… awesome… but now we have to figure out how it works.

Long story short, I dove into it one day, and got to the bottom of it, and I'm about to tell you all about it.

To be honest, the hardest part about getting it working, was that unlike the xml styled rewrites, which can take any file name and work, mod_rewrite required the '.htaccess' name for the file.

So lets get started. Open up CommandBox, at your root folder.
Instead of using the following 2 lines

server set web.rewrites.enable=true
server set web.rewrites.config=customRewrites.xml

 

You should use

 

server set web.rewrites.enable=true
server set web.rewrites.config=.htaccess

 

You can confirm your settings with the server show command at the CommandBox cli.

 

server show web.rewrites.enable
server show web.rewrites.config

 

Lets create a `.htacess` file.
Lets use this sample file.

 

RewriteEngine on
RewriteRule ^/foo/ /

# redirect mozilla to another area
RewriteCond %{HTTP_USER_AGENT} ^Mozilla.*
RewriteRule ^/no-moz-here$ /homepage.max.html [L]

 

Save your file.
If your server is running already, use

 

server restart

 

If it's not running, use

server start

 

Test out your rewrites... hope they work out as good for you, as they did for me.

More information:

Read the CommandBox Rewrite documentation here - https://ortus.gitbooks.io/commandbox-documentation/content/embedded_server/url_rewrites.html

Read the blog post about using Tuckey rewrites with CommandBox here - https://www.ortussolutions.com/blog/commandbox-and-url-rewrites-made-easy

Read the Tuckey docs here - http://cdn.rawgit.com/paultuckey/urlrewritefilter/master/src/doc/manual/4.0/index.html#configuration

 

08
December 2016

Gavin Pickin

IntoTheBox 2017, New Year, New Venue, New Format, More Great Content

cfObjective, Conferences, IntoTheBox

Ortus Solutions is happy to be an active member of the ColdFusion / CFML community, one way we contribute to the community is with opensource, another is continued education and training. After successful bootcamps, trainings, and online conferences, Ortus Solutions created their own conference, IntoTheBox in 2014. After 3 years in MN, the day prior to CF.Objective() ( also knows as dev.Objective() ), its time for IntoTheBox to make some big changes and go out on its own. ITB 2017 has a lot of changes, read more to find out all the details.

It has always been hard to jam all the great content that the Ortus team members and community members wanted to present and learn about into one day. This year we added tech tastings, but 1 day was just not enough time. In 2017, we are expanding the conference to two days. This gives us a lot of time to cover the wide range of technologies important to developers, as well as having different level of content. This way we will be able to deliver beginner and advanced sessions, and really deliver the content catered to our attendees.

Conferences are great for inspiration, high level understanding, and putting the pieces together, but a lot of attendees want to dive deeper, so we have a solution for that problem as well. Normally 3 days with cf.Objective() and then 1 day for ITB, didn't give us time for anything else, but having ITB separate, we can offer those 2 days of the conference, and a pre conference day of workshops. These workshops will be focused to dive deeper into the topic, and allow more workshop / walkthrough information, and can be truly interactive with the attendees.

We also decided to change the location of the conference, to be more centralized, with more travel options, to cater to more developers, across the United States, and to Europe.

When is the conference?
April 26th - Pre-Conference Training Workshops
April 27-28th - IntoTheBox Conference

Where is the conference?
Hyatt Place Conference Center. held?
The Woodlands ( Houston ), Texas

What are the training workshops focused on?
You will be able to get expert training from the Ortus Team on the following courses all for one All Access price.

  • Building Scalable RESTFul Services
  • Behavior Driven Development with TestBox
  • CommandBox Deep Dive
  • Building applications with ContentBox Modular CMS

What topics / sessions will be at the conference?
We are accepting topic submissions during the month of Dec 2016, we will be announcing the schedule as soon as we have it finalized.
Call for papers closes at midnight 12/31/2016. So get your submissions done before the holidays :)
Submit a topic for IntoTheBox Now

Of course we'll have all the usual topics, and more.
Ortus products: ColdBox, ContentBox, CommandBox, TextBox, MockBox, LogBox, ProfileBox, DataBoss
Developer tools and services: AWS, Mobile, Travis, Jenkins, CouchBase

Who will be there?
Most people say networking is usually just as valuable as the conference material itself. Not only will the Ortus team members will be there, members of the ColdBox Community, some new faces too, and of course, you.

Spread the word and lets make this a great event.

Find out more at IntoTheBox.org
Sign up for the email newsletter for all the latest news

Blog Search