Search code examples
apachehttpd.confvhosts

Is it impossible to have more than one alias?


I'm configuring httpd on Windows 10, and everything is okay - Except the fact that I can't configure more than one alias to the same VirtualHost.

My extra/httpd-vhosts.conf file (Variables are configured in httpd.conf):

<VirtualHost *:80>
    # Define Server Defaults
    ServerAdmin "${SERVER_ADMIN}"
    ServerName "${SERVER_NAME}"
    ServerAlias "www.${SERVER_NAME}"

    # Define public_html Directory
    DocumentRoot "${PUBLIC_HTML}"

    # Define Log Paths
    ErrorLog "${ROOTDIR}/logs/${SERVER_NAME}-error.log"
    CustomLog "${ROOTDIR}/logs/${SERVER_NAME}-access.log" common

    # Create phpMyAdmin alias
    Alias "/phpmyadmin" "${PMA}"
    <Directory "${PMA}">
        Require local
    </Directory>

    # Create an alias for old `public_html` directories
    Alias "/archive" "${ROOTDIR}/archive/"
    <Directory "${ROOTDIR}/archive/">
        Require all granted
    </Directory>
</VirtualHost>

When I check httpd -t I receive Syntax OK, and I can access http://localhost/phpmyadmin/, But I can't access http://localhost/archive/.

Screenshot: phpMyAdmin

phpMyAdmin is ok, but:

localhost/archive

/archive not.

Why?

Thank you for your help, and Please excuse my bad english.


Solution

  • Problem Solved: Yes Indeed! All I needed was:

    Options Indexes FollowSymLinks Multiviews
    

    Inside <Directory ...></Directory>.

    Code:

    <Directory "${ROOTDIR}/archive">
        Options Indexes FollowSymLinks Multiviews
        Require all granted
    </Directory>