Routes

As we've discussed, webpages in Rock don't exist as files on the server's file system. Instead, they are dynamically created as they are requested from the database to be individually tailored to the permissions of the current user. In the past this meant some really ugly URLs with numerous query parameters. For instance, some similar systems may have used an address like this:

http://www.mysite.com/index.php?page=152&groupId=12

Not only are these addresses unattractive, they are also not very friendly for search engines visiting your site (aka SEO friendly). Rock uses the concept of Routes to help beautify its addresses. The default route for a page will look something like:

http://www.rocksolidchurchdemo.com/page/123

But you can do better. Let's say page 123 in the example above was actually a promotional page for an upcoming car show. You could add a new route on the page property dialog (ti ti-settings on the page's admin bar then look under Advanced Settings) with the value of carshow. This would enable the link http://www.rocksolidchurchdemo.com/carshow to also work for this page.

Tip

Multiple Routes
In fact, you could create several routes for the same page. This is especially helpful in tracking the success of each of your marketing pieces. If the mailers, mass email and invite cards each have a different address, you can measure which is more successful at getting people to your site.

Warning

Avoid Multiple Page Routes for Indexed Pages
Having multiple routes present for a page that you wish to be indexed by search engines can be significantly damaging to that page's ranking. This is because the search engine is unable to detect that each individual route is pointing to the same page, and instead interprets them as duplicate pages, with identical content. The result is that a page with multiple routes will essentially be competing with itself, diluting its page ranking in the process.

Advanced Routes

So far, we've looked at how to create simple routes. Pages that contain dynamic content might have one or more required query parameters to be able to display. Consider a page that displays calendar events. Its default route might be http://www.rocksolidchurchdemo.com/page/234?EventId=12. Creating a route with the value of Event/{EventId} would add the ability to load the page with the address of http://www.rocksolidchurchdemo.com/Event/12. This new address is not only visually more appealing but is also SEO friendly.

You can add as many query parameters to your route as you like. For instance, the route of Event/{EventId}/{TabId} would enable the address of http://www.rocksolidchurchdemo.com/page/234?EventId=12&TabId=3 to be represented as http://www.rocksolidchurchdemo.com/Event/12/3.

If you would like to manage all routes defined in Rock, you can see them listed under Admin Tools > CMS Configuration > Routes. From here you can edit or delete any route in the system.

Note

Global Routes
From the Routes page you can designate certain routes to be Global. Global routes ignore a site's Enable Exclusive Routes setting.  

Routing Order

Rock uses the following order to choose what page is displayed for a provided URL. In cases where there is no matching route on a given site the oldest matching route from any site is used.

  1. Page ID (/page/12)
  2. Matching page route and matching site
  3. Matching Shortlink and matching site
  4. Oldest matching page route from other site
  5. Oldest matching shortlink from other site
  6. Page not found (404)

Tip

Site Scoped Routes
Keep in mind that routes are scoped to the site. That means you can use the same route more than once as long as each instance is on a different site.