Hi,
I would like to add the default language to the route if no language is specified in the url.
So when you open “siteurl.com” it changes to “siteurl.com/en”.
I was trying to achieve this in the config.php with something like this, but it doesn’t work.
c::set(‘routes’, array(
array(
‘pattern’ => ‘(?:(en|fr)/?)?(:any)’,
‘action’ => function($lang, $uri) {
if(!$lang) {
$lang = ‘en’;
return site()->visit($page, $lang);
}
)
));
Thank you
Ben