'Relay' feature? Sounds complicated and therefore tempting. I briefly refreshed the code which takes care of identyfying which page to load depending on provided url (normal default Couch routing). To create a perfect solution done right there are decisions to make -
- if the pages are going to be in the same template or possibly in different
- if redirect is silent or a note visible to user (on 404 page or intermediary template)
- if lookup executes in PHP code or in an Intermediary template in Couch code
- if file .htaccess must also be updated and whether manually or automatically
- if meta tags in HTML are needed for search engines to glue new url and old content
- if correct event is used to hook to in Couch via PHP (there are at least 2 events to wisely choose from, maybe more).
etc, etc.
Very interesting though.

P.S. All of the above applies to a potential solution for users
without the requirement of using CustomRoutes addon. If you want that to be done via Routing, then I advise to use filter - I had used it previously with success to enforce a redirect to a new page if the language changes in URL. Default example has already a filter -
page_exists, so use it for a custom lookup-and-redirect code.
- Code: Select all
<cms:route name='page_view' path='{:page_name}{:format}' filters='page_exists=name'>
<cms:route_constraints
format='(\.html)'
/>
<cms:route_validators
page_name='title_ready'
/>
</cms:route>