-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Yes, this is exacly what you want. But if you want module routes (the default routes with the Zend_Controller_Router_Route_Module), the hostname route does not help you. It only works with predefined routes. IMHO, they are better anyway, because the URLs are more SEO friendly.
In general, I would suggest you to put the common modules on another subdomain, as else you would get duplicate content in google, so a bad rating. Bill P. schrieb: > Hi Ben, > > Thanks for the reply. > > I am not sure if this is going to be what I am looking for. > What I am trying to achieve is to have one place that common scripts > such as the aclcontroller, customstuffcontroller, errorcontroller, > indexcontroller, personalaccountcontroller, etc... these would be in the > /app/commomground dir. > > When some goes to sub1.domain.com/ or sub2.domain.com/ the > indexcontroller would be called from the /commonground dir... because > there isnt an indexcontroller in the /application/sub1 or > /application/sub2 dir. > > then when someone goes to sub1.domain.com/hello, the hellocontroller > would be called but the application would also have access to find the > aclcontroller and run that for the acl control on the site. > > What you sent me, may do what I need, but not sure if i understand it right. > > We are splitting this because there will be shared controllers between > the two modules such as personalaccount. Instead of having to write two > idenitcal controllers, we are just using them there. > > Also, doing it without the module name in the url such as: > domain.com/sub1 or domain.com/sub2, it eliminates the need to write two > rules for the access control to the same info such as > domain.com/sub1/personalaccount and domain.com/sub2/personalaccount. > > Does that all make sense? > > Thanks. > Bill > > > > --- On *Fri, 8/8/08, Ben Scholzen 'DASPRiD' /<[EMAIL PROTECTED]>/* wrote: > > From: Ben Scholzen 'DASPRiD' <[EMAIL PROTECTED]> > Subject: Re: [fw-general] Subdomains and Zend Framework > To: "maxarbos" <[EMAIL PROTECTED]> > Date: Friday, August 8, 2008, 12:10 PM > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: > SHA1 > > Hi maxarbos, > > What you are looking for is the new hostname route, which will be > shipped with ZF 1.6 RC 2. > > Basically yo do the following: > > - -------------------------------------------------------------------- > a) Create your base routes: > $aclRoute = new Zend_Controller_Router_Route_Static('acl'); > $helloRoute = new Zend_Controller_Router_Route_Static('hello'); > $secretRoute = new Zend_Controller_Router_Route_Static('secret'); > > b) Create the hostname routes: > $sub1Route = new Zend_Controller_Router_Route_Hostname('sub1.d.com'); > $sub2Route = new Zend_Controller_Router_Route_Hostname('sub2.d.com'); > > c) Chain your base routes to the hostname routes > $sub1Route->chain($aclRoute) > ->chain($helloRoute); > $sub2Route->chain($aclRoute) > ->chain($secretRoute); > - -------------------------------------------------------------------- > > With this setup, you > can access the following URLs: > http://sub1.d.com/acl > http://sub1.d.com/hello > http://sub2.d.com/acl > http://sub2.d.com/secret > > This is the complete programatical way. I hadn't time to implement > config-support for the chaining yet, but I will try to get it into 1.6 > final (at least in trunk it will be in a the near future). > > Regards, > Ben > > maxarbos schrieb: > > I am trying to do something similar and any advice would be great. > > > > > > I have the following structure" > > > > /application > > --/commonground > > ----/bootstrap.php > > ----/controllers > > ------/AclController.php > > --/sub1 > > ----/controllers > > ------/HelloController.php > > --/sub2 > > ----/controllers > > ------/SecretController.php > > > > > > I have sub1.domain.com and sub2.domain.com > > Controllers in the /commonground module, should be accessible for > all > > requests (ACL and Custom functions are here as well as shared code > between > > sub1 and sub2) > > > > I want to be able to call: sub1.domain.com/hello and have the > > HelloController properly process as well as any in the /commonground if > > needed (such as ACL) > > > > Is this possible? > > > > Thank you. > > > > > > > > > > Jerry McG wrote: > >> Hi All, > >> > >> I have a file system layout similar to the recommendation at > >> > > http://framework.zend.com/manual/en/zend.controller.html#zend.controller.quickstart.go.directory > >> I would like to work with subdomains such as > http://chicago.example.com > >> and http://newyork.example.com. I have added these subdomains in my > Apache > >> virtual hosts file as well as in the Windows hosts file. Now, how can > I > >> make subdomains work in Zend Framework. Should I > create folders called > >> Chicago and Newyork and repeat the recommended layout within these > >> folders? > >> > >> Please guide me. > >> > >> Thanks! > >> > >> Jerry. > >> > > > > - -- > ................................... > : ___ _ ___ ___ ___ _ ___ : > : | \ /_\ / __| _ \ _ (_) \ : > : | |) / _ \\__ \ _/ / | |) | : > : |___/_/:\_\___/_| |_|_\_|___/ : > :........:........................: > : Web : http://www.dasprids.de : > : E-mail : [EMAIL PROTECTED] : > : Jabber : [EMAIL PROTECTED] : > : ICQ : 105677955 : > :........:........................: > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFInHAG0HfT5Ws789ARAj/vAJ9cDLO/LGtdy+vGgPQYvXzlRHpy8gCgx0NE > A/T0adjP0u27HKOi9JobOTc= > =FJh6 > -----END PGP > SIGNATURE----- > > - -- ................................... : ___ _ ___ ___ ___ _ ___ : : | \ /_\ / __| _ \ _ (_) \ : : | |) / _ \\__ \ _/ / | |) | : : |___/_/:\_\___/_| |_|_\_|___/ : :........:........................: : Web : http://www.dasprids.de : : E-mail : [EMAIL PROTECTED] : : Jabber : [EMAIL PROTECTED] : : ICQ : 105677955 : :........:........................: -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFInKPB0HfT5Ws789ARAlErAJoCcplImAVKwyb86N9+J/j2W7sv1gCeODID x0h3PCWxnBNeO+YmQEqdVZA= =nhav -----END PGP SIGNATURE-----