I have one domain: example.com, and I need to have 2 different sites with this domain like I explain below.
Site 1: example.com
Site 2: example.com/site2
I tried to do a virtual host for each site, I show below:
Site 1 virtual host:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName example.com
DocumentRoot /var/www/html/site1/
<Directory /var/www/html/site1>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Site 2:
ServerAdmin webmaster@localhost
ServerName example.com/site2
DocumentRoot /var/www/html/site2/
<Directory /var/www/html/site2>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
However it's not working, when I type example.com it redirects me to example.com/site2 but it's showing page not found, like trying to search the page /site2 under example.com, I need it to be 2 separated websites.
Hope someone can help me. I'm using wordpress and magento for the sites. example.com has Magento 2 and example.com/site2 has wordpress
Thanks!