mdev11's avatar

Sub-domains into one main domain

There are approximately 10 sub-domains and 1 main domain:

example.com
courses.example.com
shop.example.com
..

The owner wants to make it into one main domain so that the URLs would look like:

example.com/courses/login
example.com/shop/checkout
..

Currently, each sub-domain has a separate Laravel project with its own files and folders:

courses
    app
    bootstrap
    ..
shop
    app
    bootstrap
    ..

Would it be better to move the projects files inside the main domain folder like:

public_html/main/courses
public_html/main/shop

or to move all the routes and controllers into the main domain so it's only one Laravel project with all the routes and controllers?

Is there a better method?

Thanks.

0 likes
1 reply
dualklip's avatar

To make this decision you may need to know more about the business logic of the owner, but I would be inclined to think that having it all together in one Laravel can be very cost-effective in terms of effort, since if you have to do an update (of the Laravel framework or a third party library) you will only do it once, or if you have to implement a new functionality (like defining a new middleware) you will implement it in the whole application at once.

The downside is that if you need to have different logic for the same parts of the application it could be a nightmare, for example different password policies for courses and shop.

Please or to participate in this conversation.