apache Alias使用问题

今天在配置apache的过程中,使用了Alias,但是由于配置错误导致403 forbidden错误,不能正常访问。

首先理解一下Alias,Alias就是别名的意思,假如我的项目目录在/home/web/test下,可以通过配置的域名http://test.com/xxx可以正常访问test目录下的所有内容,但是在项目开发过程中,由于一些原因导致一些文件想存放于/home/web/statics下,但是也想通过

http://test.com/statics/xxx,访问位于/home/web/statics下的文件,就可以使用apache提供的Alias了。

其次,使用Alias非常方便的就可以实现上面的需求了,通过在刚在配置的test.com域名的vhosts中进行添加

Alias /statics "/home/web/statics/"
<Directory "/home/web/statics/">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
原文地址:https://www.cnblogs.com/daly2008/p/4011938.html