I want to create two Laravel applications like below:
app1.domain.com -> points to app1 laravel. Here I am allowing multiple subdomains like wildcard subdomains.
app1.domain.com/blog -> should point to blog laravel.
Database is the same for both applications, and session will be the same.
How can point these two like above?
I have pointed like below
<VirtualHost *:80>
DocumentRoot "C:\wamp64\www\app1\public"
ServerName app1.domain.local
ServerAlias *.domain.local
<Directory "C:\wamp64\www\app1\public">
Options Indexes FollowSymLinks
allow from all
order allow,deny
AllowOverride All
</Directory>
## Path to laravel sub-folder
Alias /blog/ "C:\wamp64\www\blog\public"
<Directory "C:\wamp64\www\blog\public">
AllowOverride All
</Directory>
</VirtualHost>
Using above config, app1 is working fine but blog application does not work. It shows forbidden error You don't have permission to access /blog/ on this server.
Solution:
<VirtualHost *:80>
DocumentRoot "C:\wamp64\www\app1\public"
ServerName app1.domain.local
ServerAlias *.domain.local
## Path to laravel sub-folder
Alias /blog/ "C:\wamp64\www\blog\public"
<Directory "C:\wamp64\www\blog\public">
AllowOverride All
</Directory>
<Directory "C:\wamp64\www\app1\public">
Options Indexes FollowSymLinks
allow from all
order allow,deny
AllowOverride All
</Directory>
</VirtualHost>
Now working fine but with in the blog application assets path not working correctly. assets pointing from main domain instead of subfolder. it should be like http://app1.domain.local/blog/assets/js/login.min.js?id=c818c905d151b67566ee
but loading from http://app1.domain.local/assets/js/login.min.js?id=c818c905d151b67566ee