Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

hjortur17's avatar

Subdomain

Hi, can someone assist me setting up a subdomain using Laravel Forge? I already have a website up and running but now I added dashboard and I would like to have my url for the dashboard stjornbord.bilahotel.is.

So my questions is how would I setup subdomain using Forge and DigitalOcean and have the dashboard on the subdomain?

Is it possible to have the login still on the original url? For example bilahotel.is/innskra

0 likes
4 replies
hjortur17's avatar

@tisuchi - One question, how would I redirect all traffic to stjornbord.bilahotel.is? Would that be in web.php?

Something like this?

Route::get('stjornbord.bilahotel.is/bokanir/bilahotel', 'DashboardController@bilahotel');
1 like
hjortur17's avatar

Think I might have found it:

Route::domain('{account}.example.com')->group(function () {
    Route::get('user/{id}', function ($account, $id) {
        //
    });
});
2 likes

Please or to participate in this conversation.