Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-15-2008, 11:11 PM
Junior Member
 
Join Date: Jun 2008
Posts: 1
Default Redirection from the moment someone visits a website

Hi guys,

I've been crushing my head on this one for a lot of hours..

when you go to (the wxw = www):
wxw.zend.com

you automatically get redirected to:
wxw.zend.com/en/

I want to do this too,
I already have it properly setup in my url's on the website.
(and i have zend framework set up and working)
I have a router that includes the :lang property.
Quote:
//implement multilanguage:
$defaultRoute = new Zend_Controller_Router_Route(':lang/:controller/:action');
$router = $frontController->getRouter();
$router->removeDefaultRoutes()
->addRoute('default',$defaultRoute);
so my urls are also:
/en/index/index (index controller,index action)
/nl/...
/de/...

now how can i automatically redirect someone to /en/
when people visit the first time. (later it will be a locale select, and
if nothing found a default of /en/)

I tried setting the redirect in the init() but then it's an unlimited loop.

And i don't want to build 3 seperate module folders to change the :lang to :module (the standard route)
and then copy the code 3 times but with a different locale.

thanks so much!
i've been searching 2months for the answer to help me put together
a fine piece of Zend Framework multilanguage which I can then
put on my blog as a 'how to'.

Paintrick.

Last edited by paintrick : 06-15-2008 at 11:17 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:54 PM.