403在Windows 8中设置Apache Wamp Directory别名时出现禁止错误

时间:2015-01-29 19:19:09

标签: wamp alias

我在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>

1 个答案:

答案 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"