Configure Apache .conf for Alias [closed]

一笑奈何 提交于 2019-11-26 19:44:37

问题


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


回答1:


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>


来源:https://stackoverflow.com/questions/15770778/configure-apache-conf-for-alias

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!