> www.example.com/en/about,
> www.example.com/uk/about ...

SAMPLE solution (with usage of admin routes):

// app/config/routes.php
// redirect root url to default language
if (empty($from_url) || in_array($from_url, array(CAKE_ADMIN,
CAKE_ADMIN.'/'))) {
    $url = '/';  // if You're in subfolder, customize
    if (!empty($from_url)) {
        $url .= 'CAKE_ADMIN.'/';
    }
    $url .= 'en/';

    header('Location: '.$url));
    header('HTTP/1.1 301 Moved Permanently');
    exit;
}

$Route->connect('/CAKE_ADMIN/:language/', array('admin' => CAKE_ADMIN,
'controller'=>'xyz', 'action' => 'zyx')); //admin_zyx() will be called
$Route->connect('/CAKE_ADMIN/:language/:controller/:action/*',
array('admin' => CAKE_ADMIN));

$Route->connect('/:language/', array('controller' => 'pages', 'action'
=> 'display', 'home'));
$Route->connect('/:language/pages/*', array('controller' => 'pages',
'action' => 'display'));

// Your other routes belongs here, allways starting with '/:language/'
$Route->connect('/:language/about', array('controller' => 'pages',
'action' => 'display', 'about'));

$Route->connect('/:language/:controller/:action/*');


If You're using webservices or /bare/ and /ajax/ urls, then You should
find their definitions in router's source code and define them
manually with /:language/ also (if needed).

Above example is for 1.1 - make sure You're prepending Your urls in
views with string '/'.$this->params['language'].'/'

For 1.2 just change $Route->connect() to Router::connect() and add
'language' => $this->params['language']  to Your $url array passed to
Router::url() or $html->link() etc.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to