I am sorry to ask yet another URL Management related question - couldn’t find the answer to my question anywhere though. I am pretty new to the Yii Framework but I think I’ve got the concept of routes and the path format for user friendly URLs. But I am not sure whats the best way to validate user generated slugs (eg. usernames ala domain.com/username) to protect pre-defined routes.
How do I make sure a slug is not part of a module, controller or action name or breaking any other URL Manager rules?
However, take a look at the range validator in combination with not property. You can pass all "forbidden" slugs as array and disallow user registration for those.
Though it may be hard to get all possible values. Also what happens if you want to add a section to you site - maybe a user has a slug that matches the section name? I suggest to simply use descriptive url’s.
Thank you for your fast replies and you are right about descriptive urls, but super-short profile urls are kind of a must-have for community sites these days (see facebook, twitter or myspace). I’ll try out your suggestion but I really was looking for some sort of routeExists() method. Any ideas?