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
The Alias and ScriptAlias directives are used to map between URLs and filesystem paths. This allows for content which is not directly under the DocumentRoot served as part of the web document tree. The ScriptAlias directive has the additional effect of marking the target directory as containing only CGI scripts.
Yes. HTTPD. conf is read on apache start-up, so for any changes to take affect you need to restart it.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With