Can we somehow do this. I am showing the example but we can change the below code.
<Location />
DocumentRoot /var/www/html/app1/public
</Location>
<Location /app2>
DocumentRoot /var/www/html/app2/public
</Location>
Can we somehow do this. I am showing the example but we can change the below code.
<Location />
DocumentRoot /var/www/html/app1/public
</Location>
<Location /app2>
DocumentRoot /var/www/html/app2/public
</Location>
2
Answers
Not specific to laravel. If you want Apache to serve files for 2 different applicatication then set up virtual hosts in the Apache config files
In this case you can use the
Alias
directive, like so:This will map the filesystem contents of
/var/www/html/app2/public
to/app2
while the default Document Root (/
) will be/var/www/html/app1/public
.I recommend you have a look at the documentation here, it gives a very good explanation for different solutions to your problem: https://httpd.apache.org/docs/2.4/urlmapping.html