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!



      

Reply via email to