Community RSS

Creating Custom URLs in Your Wheels App with Routes

Today, I released a chapter in the Documentation called Using Routes. Routes are a pretty cool feature of Wheels because they let you step outside of the URL convention that can sometimes feel like shackles. As I outline in the new chapter, you can create a URL like this: http://www.domain.com /user/johndoe With this line of code in your config/routes.cfm file:

<cfset addRoute(name=“userProfile”, pattern=“user/[username]”, controller=“user”, action=“profile”)>

Read on to find out how it all works.

Comments

Newsletter

Release notes and new posts, once a month. No spam.

Prefer RSS? Subscribe to the feed →