fax wrote:
Hi I am having a bit of trouble with routing.

Basically what I'm trying to achieve is a: www.mysite.com/username where
username is an alphanumeric string. The problem is that my route is catching
all requests. So even a request to an actual controller/action e.g.;
www.mysite.com/index/index will be routed as a username request.

Is it possible that if a request/url points to an actual
module/controller/action it should ignore the username route.

application.ini - routes

resources.router.routes.username.type = "Zend_Controller_Router_Route"
resources.router.routes.username.route = ":username/*"
resources.router.routes.username.defaults.controller = "profile"
resources.router.routes.username.defaults.action = "view"
resources.router.routes.username.reqs.username = "[a-z0-9-]+"

Thanks.
AFAIK this will only work if you define routes for all of your other controllers/actions.

It might be worth looking at http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.routes.hostname

This will result in username.mysite.com, that way seperating your user logic from the rest of your controllers.

Hope that helps,

Nick

Reply via email to