Host laravel application inside laravel application

Tags: , , ,

I am trying to host a laravel inside a laravel application because I need it to work on the same domain.

So imagine my domain is I am already pointing it to the public directory of a laravel project. Now I need to host another laravel project at the same domain (not subdomain).

How can I do this? For example to point to the public directory of another laravel project using nginx or apache?


I tried the solution from flakerimi, and it half works for now. I am not sure what I am doing wrong.

So I went to the apache conf for the laravel application sitting on and made the Alias /email /dir/to/other/laravel/public change and sure now all the /email routes are going to the other laravel application. I know this because it redirecting to email/login.

But I see a 404 on all /email/ routes, but not a laravel 404, a apache 404 page. Which means that apache is going to the other laravel application but it is not able to use the routes there correctly.

I tried placing RewriteBase /email in the .htaccess file of the other laravel application but no luck. Any ideas anyone?


Just like you do in localhost



edit htaccess on laravel2 RewriteBase /laravel2

on apache

ServerName some.domain

## Path to laravel domain
DocumentRoot "/path/to/some/domain/laravel1/public"
<Directory "/path/to/some/domain/laravel1/public">
    AllowOverride All

## Path to laravel sub-folder
Alias /laravel2/ "/sites/laravel2/public"
<Directory "/sites/laravel2/public">
    AllowOverride All

also check config/session.php for both installations


'cookie' => 'a_unique_name'
'path' => '/',


'cookie' => 'a_unique_name_L2'
'path' => '/laravel2',

Source: stackoverflow