I wrote a post awhile back on how to do case insensitive routing in CakePHP. The method described there doesn’t work anymore. The Cake Router now interprets the “:” character as the beginning of a named parameter.

An alternate way, which does work in RC3 is to begin your route with (?i), which will tell the regular expression engine to ignore the case for all characters to the right.

If you want to have an “about” page that is linked to by “/about”, “/About”, or “/aBoUt” you can use:

Router::connect(’/(?i)about’, array(’controller’ => ‘pages’, ‘action’ =>’display’, ‘about’));

I don’t believe there is way to set this for all routes, but if there is I would love to hear it.

Popularity: 9% [?]