I'm trying to dispatch different Symfony website within the same domain. I actually have 1 folder for each of them like :
html/site1
html/site2
html/...
Here is the .conf (CentOS & Apache) :
AliasMatch "^/site1(.*)" "/var/www/html/site1/public"
<VirtualHost *:80>
ServerName example.com
ServerAlias https://example.com
DocumentRoot /var/www/html/site1/public
<Directory /var/www/html/site1/public>
AllowOverride All
Order Allow,Deny
Allow from All
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
</Directory>
ErrorLog /etc/httpd/conf.d/site1.log
</VirtualHost>
AliasMatch "^/site2(.*)" "/var/www/html/site2/public"
<VirtualHost *:80>
ServerName example.com
ServerAlias https://example.com
DocumentRoot /var/www/html/site2/public
<Directory /var/www/html/site2/public>
AllowOverride All
Order Allow,Deny
Allow from All
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
</Directory>
ErrorLog /etc/httpd/conf.d/site2.log
</VirtualHost>
The AliasMatch seems to work, but I get an infinite loop as the result is :
example.com/siteX/index.php/index.php/index.php/index.php/index.php/index.php/... ERR_TOO_MANY_REDIRECTS
It looks like the server is trying to redirect me even if I get a response from the site, because logs are writing as if everything was working.