我在Windows 8的wamp 2.5中创建了一个目录别名。但是当我尝试从url访问目录中的文件夹时,我收到403 forbidden错误。
我的别名文件是:
Alias /test/ "D:\work\www\test/"
<Directory "D:\work\www\test/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
答案 0 :(得分:0)
来自Apache手册
Note that if you include a trailing / on the URL-path then the server
will require a trailing / in order to expand the alias. That is, if you use
Alias /icons/ /usr/local/apache/icons/
then the URL /icons will not be aliased, as it lacks that trailing /.
Likewise, if you omit the slash on the URL-path then you must
also omit it from the file-path.
所以改变
Alias /test/ "D:\work\www\test/"
到
Alias /test "D:/work/www/test"