'Install Laravel on primary domain and use it for all the addon domains is it possible?
This question might sound crazy! I have shared hosting and have limited file usage and I want to host multiple websites on the same hosting so is it possible that install laravel on the primary domain and use it for all the addon domains so this way I can reduce my file usage. Any tip will be appreciated.
Solution 1:[1]
I think the limit is not about files count, but filesystem usage. In such way no difference will it be one document root for all domains or a few instances.
But if you still need, you can configure that via nginx setup, use one document root. And by the laravel routing system you can setup different routes for different domains:
Simple example:
Route::domain('{account}.example.com')->group(function () {
Route::get('user/{id}', function ($account, $id) {
//
});
});
For more you can read the docs - https://laravel.com/docs/9.x/routing#route-group-subdomain-routing
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Fruty |
