Are you talking about the TLD changing or using a dot instead of a forward slash?
Using a dot instead of a slash.
So for example my url would look like this
www.mypage.com
but for the french it would look like this
www.mypage.fr
I made some changes to my code.
For my routes.php
Route::group(['suffix' => '{$tld}', 'before' => 'localization'], function() {
Route::get('/', function() {
return View::make('localization_test');
});
});
For my filters.php
Route::filter('localization', function() {
$tld = get_tld();
App::setLocale($tld);
});
I also created a helpers.php
if ( ! function_exists('get_tld'))
{
function get_tld()
{
$matches = array();
preg_match('/laravel-local(.[a-zA-Z]+)/', Request::root(), $matches);
$tld = $matches[1];
return $tld;
}
}
This picks up the .com, but when I try to change the .com into a .fr I get this error
Not Found
The requested URL /laravel-local.fr/public/ was not found on this server.
I'm sorry if this annoys anyone, but I'm a bit desperate at the moment. Can someone please help
I'm sorry if this annoys anyone, but I'm a bit desperate at the moment. Can someone please help
Have you got all the registered domains setup? A TLD means it is a different website.
At the moment I'm using my localhost. I've made it into a virtual host server
You can do it on your local as long as you set up all the entries in your hosts file. It will not fly on a server unless you register all those domains.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community