ubuntu - Sub-domain wildcard routing in Laravel 4.2 -
i'm working on web app , i'm intending on routing usernames sub-domains , returning details based on that.
so far have
route::group('{user}.mysite.dev', function($user) { route::get(('profile', ['uses' => 'usercontroller@profile']); });
and in nginx have next server name.
server { server_name: *.mysite.dev; }
in hosts locally have *.mysite.dev
host file entry.
my first major problem server not found. sec problem, how pass $user grouping in laravel, controllers?
can point me in right direction? give thanks you!
you should define server mysite.dev
in controller, can $user
parameter follows:
public function profile($user) { // }
and, domain route grouping should be:
route::group(array('domain' => '{user}.mysite.dev'), function() { // }
ubuntu laravel nginx laravel-4
No comments:
Post a Comment