From the documentation I have this:
AliasMatch "^/projects/(.+)" "/var/www/domain.name/$1/public"
It should match only URLs like ../projects/project1, not ../projects/ by itself.
When I go to say, http://example.org/projects/project1/ it returns a 403 Forbidden.The logs say because of:
No matching DirectoryIndex found, and server-generated directory index forbidden by Options directive.
I've tried adding a DirectoryIndex explicitly in the vhosts but to no avail. I opened up the directory (/var/www/domain.name/project1/public) to be readable by everyone and now it just shows a directory listing of the folder I want. I can see that its going to the right folder and can see the index.html file but it just doesn't automatically get it like it should.
Summarized version of my VirtualHost file:
<VirtualHost *:443>
DocumentRoot /var/www/domain.name/www/public
ServerName www.domain.name
AliasMatch "^/projects/(.+)" "/var/www/domain.name/$1/public"
ErrorDocument 401 err.php
ErrorDocument 404 err.php
ErrorDocument 500 err.php
<Directory /var/www/domain.name>
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
If I then set the permissions on the specific project folder to 755 I just get a directory listing. I've changed it back to 711.
All folders in /var/www/ are owned by username:www-data and have the permissions 711.
If I do a direct Alias to the folder i.e. Alias /projects/<actual-project-name> /var/www/domain.name/<project-name>/public it works.
index.html(or whatever the specified directory index file is) in that directory. - MrWhite"...now it just shows a directory listing of the folder I want. I can see that its going to the right folder and can see the index.html file...". Everything is fine except it doesn't fetch the index file thats there, instead it just displays a directory listing (in which I can see the index file). - JamesIndexes? YourAliasMatchdirective maps all URLs that start/projects/<project>to a single destination - is that intentional? Is/var/www/domain.name/<project>/publicunder the same document root? Add your<VirtualHost>to your question so we can have a better look. - MrWhite