Hi all, Sorry but since I didn't receive any replies to the below I wanted to try once more..
My biggest concern is how to share code between multiple sub-sites.. ZF actions seem really useful for this but then again, maybe I did my own PHP function to replicate what .htaccess mod_rewrite does...and go through the URL part by part to do redirects... Does anyone have any recommendations on how to tackle this, or does my solution above sound like the right thing to do? (i.e. custom php code to mimic .htaccess mod_rewrite, without making use of ZF actions) Please see my email below to get a better idea of what I'm trying to do. Thanks so much to everyone for your time. Thanks, Rishi --- On Wed, 6/11/08, Rishi Daryanani <[EMAIL PROTECTED]> wrote: > From: Rishi Daryanani <[EMAIL PROTECTED]> > Subject: [fw-general] Creating a multiple language website to use the same > php scripts > To: [email protected] > Date: Wednesday, June 11, 2008, 8:46 PM > Hi, > > I am setting up a site which will be divided into > subsites, one per country (for a set number of > countries). The sites will be the same (the coding > must be shared), but the content will vary depending > on the site ID or code, for example, the following > URLs should work for my site..and the key difference > would be the SITE ID as you can see below (which will > show different content from a database, based on that > site id): > > http://www.mydomain.com/ {english site} > http://www.mydomain.com/nl/ (netherlands site) > http://www.mydomain.com/de/ (german site) > > http://www.mydomain.com/ads/cars/36/ > http://www.mydomain.com/nl/ads/cars/36/ > http://www.mydomain.com/de/ads/cars/37/ > > Basically we are planning to set up the English site > under the main domain and language sites under a > directory structure like the above, so the following > would be valid: > > http://www.mydomain.com/ads/cars/36/ > {shows content in English and uses a certain > controller and view to do this} > > http://www.mydomain.com/sg/ads/cars/36/ > (must use the same controller and view, but the site > id will be different (stored in a session) and > therefore display everything in the other > language/country > > > My question - how can I do this in ZF? In the > IndexController, I know I can define functions for the > above like this: > > public function adsAction() { > } > > But then how do I make sure the same function is > called if I go to a URL like this: > http://www.mydomain.com/sg/ads/cars/36/ > > public function sgAction() { > //set session site id as "sg" > //redirect to adsAction() if /ads/ is the next item > in the URL, or redirect to productsAction if the next > item in the URL is "products", or redirect to > indexAction if there is no "next" item in the URL > } > > Can someone please let me know how to code this? I'm > still a newbie... the complication comes in because > the redirect depends on the URL. You may also have a > URL like this: > > http://www.mydomain.com/?myparameter=1 > http://www.mydomain.com/nl/?myparameter=1 > > Basically in both cases, I would want the indexAction > to be called with the appropriate session siteid set, > and the parameter would also need to be passed without > change. > > Any advice on the best way to do this? > > Many thanks!
