I would like to ask what approach should i use to handle naked domain routing in laravel 5? Given scenario like this, when a user types in example.com, I can use
Route::group(['domain' => 'example.com'], function(){
Route::get('/', function() {
return Redirect::to(URL::route('/'));
});
});
noted that route('/')
has been namespaced in the route groups www.example.com
so my question is, what if a user enters example.com/something/very/interesting, how should I redirect the user back to www.example.com/something/very/interesting ? Bare in mind that I would also like to do this to all other actions. Which means at any point of time when a user enters example.com/*
it will bring the user back to www.example.com/*
Thank You