I a running Apache/2.4.41 (Ubuntu)
I want to use only one domain name.
I would like to map different sites to different paths after the domain name.
For example:
maps to /var/www/test001/public
maps to /var/www/test002/public
I've already tried many different virtual host configurations but none of them worked.
so now I am trying to map to /srv/public , as below:
Alias /test002 /srv/test002/public_html
<Directory /srv/test002 /public_html> Order Allow,Deny Allow from all Options FollowSymLinks
</Directory>the first site woks but the second site index page only works and if I tried to redirect to another page it will give '404 page not found'
the .htaccess of the second site is :
RewriteEngine On
RewriteBase /test002/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !.(js|css|eot|svg|ttf|woff|woff2|map)$ index.php [L]
RewriteCond $1 !^(index\.php|assets)It is very weird, I have been working on it all day and no solution yet and couldn't find anything helpful on the web.
can anyone help me please?
61 Answer
I solve the problem by adding to the options in the directory :
Options +Indexes +followSymLinks
so it looks like this:
<Directory /srv/test002/public_html>
Order Allow,Deny
Allow from all
Options +Indexes +followSymLinks
</Director