[apache] Configure Apache .conf for Alias

So I cant get an alias working in "/etc/httpd/conf.d/vhosts.conf" which contains all of my virtual hosts:

<VirtualHost *> 
    ServerName example.com
    Alias /ncn /var/www/html/ncn
    DocumentRoot /var/www/html/mjp
</VirtualHost>

I want my alias to work so I can point example.com/ncn to "/var/www/html/ncn".

This works if I have it in "/etc/httpd/conf/httpd.conf" but not my "/etc/httpd/conf.d/vhosts.conf"

Any ideas why? Everything else seems to work i.e. ServerAlias's

Cheers, Peter

This question is related to apache httpd.conf

The answer is


Sorry not sure what was going on this worked in the end:

<VirtualHost *> 
    ServerName example.com
    DocumentRoot /var/www/html/mjp

    Alias /ncn "/var/www/html/ncn"

    <Directory "/var/www/html/ncn">
        Options None
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

Examples related to apache

Enable PHP Apache2 Switch php versions on commandline ubuntu 16.04 Laravel: PDOException: could not find driver How to deploy a React App on Apache web server Apache POI error loading XSSFWorkbook class How to enable directory listing in apache web server Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details How to enable php7 module in apache? java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing while starting Apache server on my computer

Examples related to httpd.conf

How to enable directory listing in apache web server Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details httpd-xampp.conf: How to allow access to an external IP besides localhost? how to configure apache server to talk to HTTPS backend server? Apache Proxy: No protocol handler was valid Forbidden You don't have permission to access / on this server How to automatically redirect HTTP to HTTPS on Apache servers? Configure Apache .conf for Alias Apache could not be started - ServerRoot must be a valid directory and Unable to find the specified module Lost httpd.conf file located apache