Source: juris-9772.medium.com

Serving Laravel from a subdirectory
I was browsing the issues on Laravel repo and came across one complaining about issues that arise from serving Laravel out of a subdirectory. Turns out there aremultiple such reports and the official answer is just that it’s not supported.

In fact there are no problems with serving it from a subdirectory as long as you take some care to set up the server and Laravel properly.

Don’t put Laravel in an actual subfolder, serve from example.com/subdirectory/public and expect Laravel to treat that as a base. You should instead redirect example.com/subdirectory to your Laravel app, provide Laravel with the full URI (including /subdirectory) and configure it to handle requests that start with that prefix.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners