Murat Güven
Murat Güven

Reputation: 25

Laravel + Digital Ocean + Serverpilot = Domain routing

i have server from Digital Ocean. I use Serverpilot. How do i domain routing using by laravel 5.3 ?

Rweb example :

Route::group(['domain' => 'admin.developer.app'], function () {
    Route::get('/', function () { return view('dash') });
});

Route::group(['domain' => 'department.developer.app'], function () {
    Route::get('/', function () { return view('dash') });
});

Upvotes: 0

Views: 179

Answers (1)

Rápli András
Rápli András

Reputation: 3923

You need access to DNS zonefile settings at your DNS provider.

  • Set up a catchall DNS entry (an A record for * pointing to your server address)
  • Your .htaccess file must be set up correctly that it catches all subdomains and renders developer.app for your routing to work correctly. (I think the default laravel .htaccess is fine)
  • Add ServerAlias *.developer.app to your VirtualHost config and restart the webserver

Upvotes: 2

Related Questions