04-23-2019, 09:45 PM
Hello everybody,
I am working with codeigniter 4. I have a problem.
how can i recognize language abbreviation in url.
with
I tried but the problem is the following.
1. for all routes {locale} must be defined.
2. without language abbreviation the controller is not found.
3. $routes->setAutoRoute(true); no longer works.
it has to work like this:
when user enters the URL:
www.domain.com requires its browser language to be recognized and redirected to www.domain.com/en/
and if user enters the URL www.domain.com/de/ the locale must be changed in German.
this must work as well:
http://www.domain.com/contoller/method redirect to http://www.domain.com/en/contoller/method
I look forward to your suggestions
thanks
I am working with codeigniter 4. I have a problem.
how can i recognize language abbreviation in url.
with
PHP Code:
$routes->get('{locale}/books', 'App\Books::index');
I tried but the problem is the following.
1. for all routes {locale} must be defined.
2. without language abbreviation the controller is not found.
3. $routes->setAutoRoute(true); no longer works.
it has to work like this:
when user enters the URL:
www.domain.com requires its browser language to be recognized and redirected to www.domain.com/en/
and if user enters the URL www.domain.com/de/ the locale must be changed in German.
this must work as well:
http://www.domain.com/contoller/method redirect to http://www.domain.com/en/contoller/method
I look forward to your suggestions
thanks