apache httpd.conf 路径配置

DocumentRoot "/Users/worldzhy/Documents/InceptionPad"
<Directory "/Users/worldzhy/Documents/InceptionPad">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options FollowSymLinks Multiviews
    MultiviewsMatch Any

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>


Alias /execsearch/ /Users/worldzhy/Documents/InceptionPad/ExecSearch/public/
<Directory "/Users/worldzhy/Documents/InceptionPad/ExecSearch">
        Options FollowSymLinks Multiviews
        MultiviewsMatch Any
        AllowOverride All
        Require all granted
</Directory>


请看这段配置,特别需要注意。

1.Alias /execsearch/  这里最后如果有/,那么/Users/worldzhy/Documents/InceptionPad/ExecSearch/public/ 最后也要有/。

否则就会路由就会有问题。


2.通过试验,如果最后都有/,那么访问http://localhost/execsearch 是不行的,错误如下:

403 Forbidden  You don't have permission to access /execsearch on this server.  


3.但是如果最后都没有/,那么访问http://localhost/execsearch 和 http://localhost/execsearch/ 都是可行的。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值