Question

I want to create routes to also get links like:

  • my.site.com(/:controller/:action)
  • admin.site.com(/:controller/:action)

I tried to add:

resources.router.routes.www.type = "Zend_Controller_Router_Route_Hostname"
resources.router.routes.www.route = ":module.nameofmysite.com"
resources.router.routes.www.defaults.module = "default"
resources.router.routes.www.chains.index.type = "Zend_Controller_Router_Route"
resources.router.routes.www.chains.index.route = ":controller/:action/*"
resources.router.routes.www.chains.index.defaults.controller = "index"
resources.router.routes.www.chains.index.defaults.action = "index"

But nothing happens.. (Server not found), how do I fix this?

I've read the zend documentation about this but I still can't get it to work.

Was it helpful?

Solution

I had a similar problem using wildcard subdomains on a local enviroment. I was sure of my routing however the hosts file didin't contain the subdomain. This worked for me

127.0.0.1  mydomain.local
127.0.0.1  subdomain.mydomain.local
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top