This configuration was working on Apache version 2.3 however, when I updated to Apache/2.4.34 (Unix) PHP/7.2.11 its not longer working. Only the first and second directives are, but the third isn't, its only showing index of the root of the folder, when its supposed to add the folder in the DEFINE as defined. Has anything changed in Apache/2.4.34, can't find any thing to resolve the issue or maybe am missing something.
PS. I have checked other Q&A the had a similar issue but none of the solutions worked.
This question is different due to the following:
- Its addressing dynamic vitual host and not static
- This is using apache version 2.4 not 2.2 as the indicated answer is.
- The entire configuration of this vhost file is different to the indicated answer
Thanks
Define USER currentUser
Define PATH "/Users/${USER}/Sites"
Define CRAFT2 public
Define CRAFT3 web
<VirtualHost *:80>
ServerName localhost
DocumentRoot ${PATH}
</VirtualHost>
<VirtualHost *:80>
ServerAlias *.dv
UseCanonicalName Off
VirtualDocumentRoot ${PATH}/%1
</VirtualHost>
<VirtualHost *:80>
ServerAlias *.dv
UseCanonicalName Off
VirtualDocumentRoot ${PATH}/%1/${CRAFT3}
</VirtualHost>
ServerName
directive. Without it,ServerAlias
is ignored.ServerName
.ServerName
. But 2.4 is not 2.2. It doesn't work that way anymore. You must have aServerName
now.