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

sylvain92's avatar

multiple laravel in subdirectory

Hi how to config lemp server for multiple laravel in subdirectory?

exemple.com/blog1 exemple.com/blog2

each blog are instance from laravel

regards

0 likes
9 replies
sylvain92's avatar

not really, both links related to setup new domain for each subfolder. ie toto.com and titit.com

but in my case, i only need toto.com/blog1 and toto.com/blog2

i think, need change on laravel only.

automica's avatar

if you are limited by owning a single domain then perhaps you could look at using subdomains

eg toto.com/blog1 redirects to blog1.toto.com and a similar arrangement for your blog2.

it might be possible to put your codebase outside of public_html and then rename /public to blog1 but this is a fiddly way of dealing with this.

i'd be considering what makes blog1 and blog2 different and how extendable this would be if you were bringing in blog3.

if you 2 blogs are 2 people blogging on the same domain then that's perfectly easy to do in a single install of Laravel.

sylvain92's avatar

because i will need to make blog200 ... then i wish not have to manage DNS. But only duplicate project and start to develop.

automica's avatar

i'm hosting with a domain handled by cpanel and it is very easy to add subdomains.

My current Laravel projects are side by side in a single directory and I have subdomains set to serve each site as a separate site and that will make going to production much simpler.

Whilst I don't doubt you cant achieve what you're trying to do by serving side by side in the same webroot, you are making it difficult to go to live with your individual blogs.

whats the difference between blog1 and blog2? are they different categories or different customers?

Please or to participate in this conversation.