您的位置:首页 > 理论基础 > 计算机网络

apache httpd.conf 路径配置

2016-05-27 17:27 281 查看
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/ 都是可行的。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: